From e716c830d5becf5f8884e21747f443ba37201fb2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 21 May 2014 06:05:42 -0400 Subject: [PATCH] feature(util) exec: add test --- test/lib/util.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/lib/util.js b/test/lib/util.js index 5606d3e3..5cb6aab1 100644 --- a/test/lib/util.js +++ b/test/lib/util.js @@ -59,6 +59,26 @@ same.should.be.false; }); }); + + describe('exec', function() { + it('should execute function with parameters', function() { + var WORD = 'hello', + func = function(word) { + return word; + }, + word = Util.exec(func, WORD); + + WORD.should.equal(word); + }); + + it('should not execute function, if type of first argument not function', function() { + var WORD = 'hello', + word = Util.exec(WORD); + + (word === undefined).should.be.true; + }); + }); + }); })();