Skip to content

Commit

Permalink
[bin test] Added additional teardown test. Update bin/vows to support…
Browse files Browse the repository at this point in the history
… absolute path. #83
  • Loading branch information
indexzero committed Aug 12, 2011
1 parent c8ee815 commit 889b748
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/vows
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ if (! options.watch) {
reporter.print = _reporter.print;

files = args.map(function (a) {
return path.join(process.cwd(), a.replace(fileExt, ''));
return (!a.match(/^\//))
? path.join(process.cwd(), a.replace(fileExt, ''))
: a.replace(fileExt, '');
});

runSuites(importSuites(files), function (results) {
Expand Down
5 changes: 5 additions & 0 deletions test/vows-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@ vows.describe("Vows with teardowns").addBatch({
"And a final vow": function (topic) {
assert.isTrue(topic.flag);
},
'subcontext': {
'nested': function (_, topic) {
assert.isTrue(topic.flag);
}
},
teardown: function (topic) {
topic.flag = false;
},
Expand Down

0 comments on commit 889b748

Please sign in to comment.