1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | var fs = require('fs'),
|
9 | path = require('path'),
|
10 | vows = require('vows'),
|
11 | assert = require('assert'),
|
12 | helpers = require('./helpers'),
|
13 | nconf = require('../lib/nconf');
|
14 |
|
15 | var mergeDir = path.join(__dirname, 'fixtures', 'merge'),
|
16 | files = fs.readdirSync(mergeDir).map(function (f) { return path.join(mergeDir, f) });
|
17 |
|
18 | vows.describe('nconf/common').addBatch({
|
19 | "Using nconf.common module": {
|
20 | "the loadFiles() method": {
|
21 | topic: function () {
|
22 | nconf.loadFiles(files, this.callback);
|
23 | },
|
24 | "should merge the files correctly": helpers.assertMerged
|
25 | },
|
26 | "the loadFilesSync() method": {
|
27 | "should merge the files correctly": function () {
|
28 | helpers.assertMerged(null, nconf.loadFilesSync(files));
|
29 | }
|
30 | }
|
31 | }
|
32 | }).export(module); |
\ | No newline at end of file |