1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Fix a test and add some more

This commit is contained in:
Ruben Bridgewater
2015-09-30 02:04:56 +02:00
parent fba050802b
commit afcd760b18
4 changed files with 110 additions and 9 deletions

View File

@ -11,17 +11,25 @@ describe("The 'client' method", function () {
var pattern = /addr=/;
describe("using " + parser + " and " + ip, function () {
var client;
var client, client2;
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});
beforeEach(function (done) {
client2 = redis.createClient.apply(redis.createClient, args);
client2.once("ready", function () {
done();
});
});
afterEach(function () {
client.end();
client2.end();
});
describe('list', function () {
@ -52,6 +60,25 @@ describe("The 'client' method", function () {
});
});
});
describe('setname / getname', function () {
it('sets the name', function (done) {
helper.serverVersionAtLeast.call(this, client, [2, 6, 9]);
client.client("setname", "RUTH", helper.isString('OK'));
client2.client("setname", "RENEE", helper.isString('OK'));
client2.client("setname", "MARTIN", helper.isString('OK'));
client2.client("getname", function(err, res) {
assert.equal(res, 'MARTIN');
});
client.client("getname", function(err, res) {
assert.equal(res, 'RUTH');
done();
});
});
});
});
});
});