aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/file-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/file-test.js')
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/file-test.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/file-test.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/file-test.js
new file mode 100644
index 00000000..93ea089e
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/utile/test/file-test.js
@@ -0,0 +1,31 @@
+/*
+ * file-test.js: Tests for `utile.file` module.
+ *
+ * (C) 2011, Nodejitsu Inc.
+ * MIT LICENSE
+ *
+ */
+
+var assert = require('assert'),
+ path = require('path'),
+ vows = require('vows'),
+ macros = require('./helpers/macros'),
+ utile = require('../');
+
+var fixture = path.join(__dirname, 'fixtures', 'read-json-file', 'config.json');
+
+vows.describe('utile/file').addBatch({
+ 'When using utile': {
+ 'the `.file.readJson()` function': {
+ topic: function () {
+ utile.file.readJson(fixture, this.callback);
+ },
+ 'should return correct JSON structure': macros.assertReadCorrectJson
+ },
+ 'the `.file.readJsonSync()` function': {
+ topic: utile.file.readJsonSync(fixture),
+ 'should return correct JSON structure': macros.assertReadCorrectJson
+ }
+ }
+}).export(module);
+