From 8a79ef04fd9582f3a21a81aa8403631cf996d707 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 22 May 2011 13:01:49 -0700 Subject: [PATCH] test retrieving non-existent keys and drilling into non-objects --- test/memory-store-test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/memory-store-test.js b/test/memory-store-test.js index a0a3f8f..210879a 100644 --- a/test/memory-store-test.js +++ b/test/memory-store-test.js @@ -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": {