Permalink
Browse files

[tap] now works with this instead of encapsulation

  • Loading branch information...
1 parent dedb3f5 commit 6ad49f5ae4e0e6517d6099c433251a7e3b4b5907 @dscape committed Sep 9, 2011
Showing with 7 additions and 5 deletions.
  1. +1 −1 engines/tap.js
  2. +6 −4 test/tap.js
View
@@ -14,7 +14,7 @@ module.exports = exports = function(name,tests,module,selected) {
test(name, function (t) {
t.plan(total);
test_names.forEach(function(name) {
- tests[name](tests[name+'_ok'](t));
+ tests[name](function () { this.t = t; return tests[name+'_ok'] }());
});
});
};
View
@@ -3,13 +3,15 @@ var ensure = require('../ensure').use('tap')
;
tests.tap = function (cb) { cb('foo'); };
-tests.tap_ok = function (t) {
- return function (value) { t.equal(value,'foo'); };
+tests.tap_ok = function (value) {
+ var t = this.t;
+ t.equal(value,'foo');
};
tests.plan_works = function (cb) { cb('bar'); };
-tests.plan_works_ok = function (t) {
- return function (value) { t.equal(value,'bar'); };
+tests.plan_works_ok = function (value) {
+ var t = this.t;
+ t.equal(value,'bar');
};
ensure((__filename + '_tap'),tests,module);

0 comments on commit 6ad49f5

Please sign in to comment.