From 7fc416f18a69ca571013a6db83fc8f0f1f6a3dc6 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 4 Jun 2015 17:14:22 -0400 Subject: [PATCH] test fix --- tests/database/keys.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/database/keys.js b/tests/database/keys.js index 43a44e5753..36e5fe5989 100644 --- a/tests/database/keys.js +++ b/tests/database/keys.js @@ -7,6 +7,9 @@ var async = require('async'), describe('Key methods', function() { + beforeEach(function(done) { + db.set('testKey', 'testValue', done); + }); it('should set a key without error', function(done) { db.set('testKey', 'testValue', function(err) { @@ -56,11 +59,15 @@ describe('Key methods', function() { }); }); - it('should return false if key does not exist or was deleted', function(done) { - db.exists('testKey', function(err, exists) { + it('should return false if key was deleted', function(done) { + db.delete('testKey', function(err) { assert.equal(err, null); - assert.strictEqual(exists, false); - done(); + assert.equal(arguments.length, 1); + db.exists('testKey', function(err, exists) { + assert.equal(err, null); + assert.strictEqual(exists, false); + done(); + }); }); });