Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / utile / test / file-test.js
1 /*
2  * file-test.js: Tests for `utile.file` module.
3  *
4  * (C) 2011, Nodejitsu Inc.
5  * MIT LICENSE
6  *
7  */
8
9 var assert = require('assert'),
10     path = require('path'),
11     vows = require('vows'),
12     macros = require('./helpers/macros'),
13     utile = require('../');
14
15 var fixture = path.join(__dirname, 'fixtures', 'read-json-file', 'config.json');
16
17 vows.describe('utile/file').addBatch({
18   'When using utile': {
19     'the `.file.readJson()` function': {
20       topic: function () {
21         utile.file.readJson(fixture, this.callback);
22       },
23       'should return correct JSON structure': macros.assertReadCorrectJson
24     },
25     'the `.file.readJsonSync()` function': {
26       topic: utile.file.readJsonSync(fixture),
27       'should return correct JSON structure': macros.assertReadCorrectJson
28     }
29   }
30 }).export(module);
31