1 | var yargs = require('yargs');
|
2 | var path = require('path');
|
3 | var should = require('should');
|
4 |
|
5 | var Loader = require('../index');
|
6 | var loader = new Loader();
|
7 |
|
8 | describe('yaml-config-loader', function() {
|
9 | describe('add', function() {
|
10 | it('should detect the type added and add it appropriately', function(done) {
|
11 |
|
12 |
|
13 | loader.add(path.join(__dirname, 'fixtures', 'fileLoader', 'config1.yaml'));
|
14 | loader.add(path.join(__dirname, 'fixtures', 'directoryLoader', 'valid'));
|
15 | loader.add({'firstMate': 'William T. Riker'});
|
16 | loader.load(function(error, config) {
|
17 | should.not.exist(error);
|
18 | config.captain.should.equal('Jean-Luc Picard');
|
19 | config.firstMate.should.equal('William T. Riker');
|
20 | config.doctor.should.equal('Beverly Crusher');
|
21 | config.vulcan.should.equal('Spok');
|
22 | config.android.should.equal('Data');
|
23 | done(error);
|
24 | });
|
25 | });
|
26 | });
|
27 | });
|
28 |
|