feature(util) exec: add test

This commit is contained in:
coderaiser 2014-05-21 06:05:42 -04:00
parent 18e1f4ce22
commit e716c830d5

View file

@ -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;
});
});
});
})();