Skip to content

Commit

Permalink
formatting and semi colons
Browse files Browse the repository at this point in the history
  • Loading branch information
tokumine committed Jun 1, 2012
1 parent aa1e306 commit 22923e3
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions test/unit/redis_pool.test.js
@@ -1,45 +1,43 @@
require('../helper');

require('../helper');
var _ = require('underscore')
, redis_pool = require('../../app/models/redis_pool')
, assert = require('assert');


exports['test truth'] = function(){
assert.ok(true, 'it is');
assert.ok(true, 'it is');
};

exports['test can instantiate a RedisPool object'] = function(){
assert.ok(redis_pool);
}
};

exports['test pool object has an aquire function'] = function(){
assert.includes(_.functions(redis_pool), 'acquire');
}
};

exports['test calling aquire returns a redis client object that can get/set'] = function(beforeExit){
redis_pool.acquire(0, function(client){
client.set("key","value")
client.set("key","value");
client.get("key", function(err,data){
assert.eql(data, "value");
redis_pool.release(0, client); // needed to exit tests
})
redis_pool.release(0, client);
});
});
}
};

exports['test calling aquire on another DB returns a redis client object that can get/set'] = function(beforeExit){
redis_pool.acquire("MYDATABASE", function(client){
client.set("key","value")
client.set("key","value");
client.get("key", function(err,data){
assert.eql(data, "value");
redis_pool.release("MYDATABASE", client); // needed to exit tests
redis_pool.release("MYDATABASE", client);
})
});

redis_pool.acquire("MYDATABASE", function(client){
client.get("key", function(err,data){
assert.eql(data, "value");
redis_pool.release("MYDATABASE", client); // needed to exit tests
})
redis_pool.release("MYDATABASE", client);
});
});
}
};

0 comments on commit 22923e3

Please sign in to comment.