Clean handling of redis connection failures in testcase

This commit is contained in:
Sandro Santilli 2013-09-12 17:48:35 +02:00
parent a7cc7ceeb8
commit 730f9534dc

View File

@ -38,6 +38,7 @@ suite('redis_pool', function() {
test('calling aquire returns a redis client object that can get/set', function(done){
redis_pool.acquire(0, function(err, client){
if ( err ) { done(err); return; }
client.set("key","value");
client.get("key", function(err,data){
assert.equal(data, "value");
@ -49,6 +50,7 @@ suite('redis_pool', function() {
test('calling aquire on another DB returns a redis client object that can get/set', function(done){
redis_pool.acquire(2, function(err, client){
if ( err ) { done(err); return; }
client.set("key","value");
client.get("key", function(err,data){
assert.equal(data, "value");