public
Description: A JavaScript BDD Testing Library
Homepage: http://www.yehudakatz.com
Clone URL: git://github.com/wycats/jspec.git
Search Repo:
added support for pending specs
Phil Hagelberg (author)
Tue Feb 05 15:36:52 -0800 2008
commit  e3cffb960dfe24c1831522d22afc12d237dae302
tree    424c66d76ce1a39eb26dfed45ec9c2ee247c3728
parent  798da3d0aa19f5456efcbe8b5ba1df4628c5207b
...
3
4
5
6
 
7
8
9
10
...
27
28
29
 
 
 
 
30
31
32
33
34
35
36
37
38
 
 
 
 
 
 
 
39
40
41
...
3
4
5
 
6
7
8
9
10
...
27
28
29
30
31
32
33
34
35
36
37
38
39
 
 
 
40
41
42
43
44
45
46
47
48
49
0
@@ -3,7 +3,7 @@
0
     return fn.toString().match(/^[^\{]*{((.*\n*)*)}/m)[1];
0
   },
0
   TOP_LEVEL: 0, DESCRIBE: 1, IT_SHOULD_PASS: 2, IT_SHOULD_FAIL: 3,
0
- FAILURE: 4, DONE_EXAMPLE: 5, DONE_GROUP: 6,,
0
+ FAILURE: 4, DONE_EXAMPLE: 5, DONE_GROUP: 6, PENDING: 7,
0
   logger: function(state, message) {
0
     switch(state) {
0
       case jspec.TOP_LEVEL:
0
0
@@ -27,15 +27,23 @@
0
         break;
0
       case jspec.DONE_GROUP:
0
         console.groupEnd();
0
+ break;
0
+ case jspec.PENDING:
0
+ console.warn("Pending: " + message);
0
+ break;
0
     }
0
     
0
   },
0
   describe: function(str, desc) {
0
     jspec.logger(jspec.TOP_LEVEL, str);
0
     var it = function(str, fn) {
0
- jspec.logger(jspec.DESCRIBE, str);
0
- fn();
0
- jspec.logger(jspec.DONE_EXAMPLE);
0
+ if(fn) {
0
+ jspec.logger(jspec.DESCRIBE, str);
0
+ fn();
0
+ jspec.logger(jspec.DONE_EXAMPLE);
0
+ } else {
0
+ jspec.logger(jspec.PENDING, str);
0
+ };
0
     };
0
     var Expectation = function(p) { this.expectation = p; };
0
     Expectation.prototype.to = function(fn_str, to_compare, not) {

Comments

    No one has commented yet.