Permalink
Browse files

removed nasty evals, legacy code

  • Loading branch information...
1 parent 359a219 commit faf404430533c42c6d8836fb2476ce7d6532f38c @dscape committed Aug 31, 2011
Showing with 7 additions and 3 deletions.
  1. +4 −0 README.md
  2. +2 −2 ensure.js
  3. +1 −1 package.json
View
@@ -23,4 +23,8 @@
ensure('foo', tests, module);
+Now run it:
+
+ node foo.js
+
[1]: http://npmjs.org
View
@@ -8,8 +8,8 @@ var _ = require('underscore')
module.exports = exports = function(name,tests,module) {
test_names = _.filter(_.keys(tests), function(e){ return e.indexOf('_ok') === -1; });
_.foldl(test_names, function(memo,e) {
- t = eval('tests.'+ e);
- ok = eval('tests.'+ e + '_ok');
+ t = tests[e];
+ ok = tests[e + '_ok'];
memo[e] = { topic: function () { t(this.callback); }
, ok: ok
};
View
@@ -2,7 +2,7 @@
, "description": "vows made easy"
, "homepage": "http://github.com/dscape/ensure"
, "repository": "git://github.com/dscape/ensure"
-, "version": "0.0.1"
+, "version": "0.0.2"
, "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 faf4044

Please sign in to comment.