Skip to content

Commit

Permalink
test retrieving non-existent keys and drilling into non-objects
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonjs committed May 22, 2011
1 parent 6acc1fc commit 8a79ef0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/memory-store-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 8a79ef0

Please sign in to comment.