2011-11-20 21:21:09 +00:00
|
|
|
/*
|
|
|
|
* literal-test.js: Tests for the nconf literal store.
|
|
|
|
*
|
2011-11-24 05:33:08 +00:00
|
|
|
* (C) 2011, Nodejitsu Inc.
|
2011-11-20 21:21:09 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
var vows = require('vows'),
|
|
|
|
assert = require('assert'),
|
|
|
|
helpers = require('../helpers'),
|
|
|
|
nconf = require('../../lib/nconf');
|
|
|
|
|
|
|
|
vows.describe('nconf/stores/literal').addBatch({
|
2011-11-23 02:22:09 +00:00
|
|
|
"An instance of nconf.Literal": {
|
|
|
|
topic: new nconf.Literal({
|
2011-11-24 05:15:07 +00:00
|
|
|
foo: 'bar',
|
|
|
|
one: 2
|
2011-11-20 21:21:09 +00:00
|
|
|
}),
|
|
|
|
"should have the correct methods defined": function (literal) {
|
|
|
|
assert.equal(literal.type, 'literal');
|
|
|
|
assert.isFunction(literal.get);
|
|
|
|
assert.isFunction(literal.set);
|
|
|
|
assert.isFunction(literal.merge);
|
2011-11-23 21:41:07 +00:00
|
|
|
assert.isFunction(literal.loadSync);
|
2011-11-20 21:21:09 +00:00
|
|
|
},
|
|
|
|
"should have the correct values in the store": function (literal) {
|
|
|
|
assert.equal(literal.store.foo, 'bar');
|
|
|
|
assert.equal(literal.store.one, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).export(module);
|