diff options
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/format-test.js')
-rw-r--r-- | vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/format-test.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/format-test.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/format-test.js new file mode 100644 index 00000000..fb1a2b74 --- /dev/null +++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/format-test.js @@ -0,0 +1,31 @@ +/* + * format-test.js: Tests for `utile.format` module. + * + * (C) 2011, Nodejitsu Inc. + * MIT LICENSE + * + */ + +var vows = require('vows'), + assert = require('assert'), + utile = require('../lib'); + +vows.describe('utile/format').addBatch({ + + 'Should use the original `util.format` if there are no custom parameters to replace.': function() { + assert.equal(utile.format('%s %s %s', 'test', 'test2', 'test3'), 'test test2 test3'); + }, + + 'Should use `utile.format` if custom parameters are provided.': function() { + assert.equal(utile.format('%a %b %c', [ + '%a', + '%b', + '%c' + ], [ + 'test', + 'test2', + 'test3' + ]), 'test test2 test3'); + } + +}).export(module); |