test retrieving non-existent keys and drilling into non-objects

master
Sami Samhuri 2011-05-22 13:01:49 -07:00
parent 6acc1fc533
commit 8a79ef04fd
1 changed files with 10 additions and 0 deletions

View File

@ -28,6 +28,16 @@ vows.describe('nconf/stores/memory').addBatch({
assert.equal(store.get('falsy:string'), '');
assert.equal(store.get('falsy:boolean'), false);
assert.equal(store.get('falsy:object'), null);
},
"should not fail when retrieving non-existent keys": function (store) {
assert.doesNotThrow(function() {
assert.equal(store.get('this:key:does:not:exist'), undefined);
}, TypeError);
},
"should not fail when drilling into non-objects": function (store) {
assert.doesNotThrow(function() {
assert.equal(store.get('falsy:number:uh:oh'), undefined);
}, TypeError);
}
},
"the clear() method": {