/*!
 * wef.cssParser tests
 * Copyright (c) 2011 Pablo Escalada
 * MIT Licensed
 */
module("cssParser");
test("namespace", function() {
    notEqual(wef.cssParser , undefined, "is wef.cssParser namespace defined?");
    equal(typeof wef.cssParser, "function", "is wef.cssParser a function?");
});

test("constructor", function() {
    equal(typeof wef.cssParser(), "object", "empty constructor returns an object");
});

test("public properties", function() {
    equal(typeof wef.cssParser().version, "string", "wef.cssParser().version");
});

test("pubic methods", function() {
    var text = 'body { height: 100%; display: "a.b.c"  /2em "....."  /1em "d.e.f" "....."  /1em "g.h.i"  /2em 5em 1em  *  1em 10em}';
    notEqual(wef.cssParser().parse(text), null, "parse(string) ok");
});

test("parse", function() {
    notEqual(wef.cssParser().parse("asd"), null, "parse(empty string) ok");
    equals(wef.cssParser().parse(444), null, "parse(number) returns null");
    equals(wef.cssParser().parse(), null, "parse() returns null");
    equals(wef.cssParser().parse(null), null, "parse(null) returns null");
    notEqual(wef.cssParser().parse(""), null, "parse(empty string) ok");
});
@@ -815,91 +815,146 @@
     
-notEqual(wef.cssParser().parse(%22asd%22), null, %22parse(empty string) ok%22);%0A    equals(
+raises(function() %7B%0A        wef.cssParser().parse(%22asd%22);%0A    %7D, %22invalid css data throws an exception%22);%0A    raises(function() %7B%0A        
 wef.
@@ -975,22 +975,23 @@
 rse(444)
-, null
+;%0A    %7D
 , %22parse
@@ -1003,35 +1003,63 @@
 er) 
-returns null%22);%0A    equals(
+throws an exception%22);%0A    raises(function() %7B%0A        
 wef.
@@ -1077,22 +1077,22 @@
 .parse()
-, null
+%0A    %7D
 , %22parse
@@ -1096,37 +1096,74 @@
 rse(
-) returns null%22);%0A    equals(
+undefined) throws an exception%22);%0A    raises(function() %7B%0A        
 wef.
@@ -1185,22 +1185,22 @@
 se(null)
-, null
+%0A    %7D
 , %22parse
@@ -1210,93 +1210,127 @@
 ll) 
-returns null%22);%0A    notEqual(wef.cssParser().parse(%22%22), null, %22parse(empty string) ok
+throws an exception%22);%0A    raises(function() %7B%0A        wef.cssParser().parse(%22%22)%0A    %7D, %22empty data throws an exception
 %22);%0A

Fix parse test