Permalink
Browse files

fixed serious bug

  • Loading branch information...
1 parent faf4044 commit 2622740e3496ab82765d5e97bcff3c1d78f8cd2e @dscape committed Aug 31, 2011
Showing with 5 additions and 7 deletions.
  1. +4 −6 ensure.js
  2. +1 −1 package.json
View
@@ -1,17 +1,15 @@
var _ = require('underscore')
, vows = require('vows')
, assert = require('assert')
- , batch = {}
- , f, ok, test_names;
+ , batch = {};
module.exports = exports = function(name,tests,module) {
+ var f, ok, test_names;
test_names = _.filter(_.keys(tests), function(e){ return e.indexOf('_ok') === -1; });
_.foldl(test_names, function(memo,e) {
- t = tests[e];
- ok = tests[e + '_ok'];
- memo[e] = { topic: function () { t(this.callback); }
- , ok: ok
+ memo[e] = { topic: function () { tests[e](this.callback); }
+ , ok: tests[e + '_ok']
};
return memo; }, batch);
vows.describe('foo').addBatch(batch).exportTo(module);
View
@@ -2,7 +2,7 @@
, "description": "vows made easy"
, "homepage": "http://github.com/dscape/ensure"
, "repository": "git://github.com/dscape/ensure"
-, "version": "0.0.2"
+, "version": "0.0.3"
, "author": "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)"
, "keywords": ["vows", "testing"]
, "dependencies": {"vows": "~0.5.10", "underscore": "~1.1.7"}

0 comments on commit 2622740

Please sign in to comment.