From 889b748e5bdce9d28226f443faa6494d394450ec Mon Sep 17 00:00:00 2001 From: indexzero Date: Tue, 26 Jul 2011 23:24:00 -0700 Subject: [PATCH] [bin test] Added additional teardown test. Update bin/vows to support absolute path. #83 --- bin/vows | 4 +++- test/vows-test.js | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/vows b/bin/vows index 9b9ccf7..c6415ba 100755 --- a/bin/vows +++ b/bin/vows @@ -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) { diff --git a/test/vows-test.js b/test/vows-test.js index 34f90ae..0568236 100644 --- a/test/vows-test.js +++ b/test/vows-test.js @@ -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; },