Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 844069d
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.swp | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = function(tests) { | ||
var results = {}; | ||
|
||
function parse(tests, prefix) { | ||
for (var i in tests) { | ||
if (tests[i] instanceof Function) { | ||
results[(prefix.length ? ('[' + prefix.join('][') + ']: ') : '') + i] = tests[i]; | ||
} else { | ||
parse(tests[i], prefix.concat([i])); | ||
} | ||
} | ||
} | ||
|
||
parse(tests, []); | ||
|
||
console.log(results); | ||
|
||
return results; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name" : "expressobdd", | ||
"version" : "v1.0.0", | ||
"description" : "Add basic multilevel describe/it bdd constructs to expresso", | ||
"homepage" : "http://github.com/nharbour/expressobdd", | ||
"keywords" : ["expresso", "expressobdd", "bdd", "test", "testing", "tests"], | ||
"author" : "Eugene Ware <eugene@noblesamurai.com>", | ||
"maintainers" : ["Eugene Ware <eugene@noblesamurai.com>"], | ||
"licenses" : ["MIT"], | ||
"dependencies" : {"expresso": ">=0.7.2", "should": ">=0.0.4"}, | ||
"main" : "./lib/expressobdd", | ||
"repository" : { "type": "git", "url": "http://github.com/nharbour/expressobdd.git" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require('should'); | ||
|
||
module.exports = require('../lib/expressobdd')({ | ||
'group one': { | ||
'it should do x': function() { | ||
var x = 2; | ||
x.should.eql(2); | ||
}, | ||
|
||
'it should do y': function() { | ||
var y = 3; | ||
y.should.eql(3); | ||
}, | ||
|
||
'group one point 2': { | ||
'it should do w': function() { | ||
var z = 5; | ||
z.should.eql(6); | ||
}, | ||
}, | ||
}, | ||
'it should do z': function() { | ||
var z = 4; | ||
z.should.eql(4); | ||
}, | ||
}); |