1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Fix multi not being executed on node 0.10 if not yet ready. Closes #889

This commit is contained in:
Ruben Bridgewater
2015-10-14 02:24:11 +02:00
parent a408235a38
commit 0d4d4d7416
3 changed files with 40 additions and 8 deletions

View File

@@ -50,6 +50,26 @@ describe("The 'multi' method", function () {
describe("when connected", function () {
var client;
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", done);
});
afterEach(function () {
client.end();
});
it("executes a pipelined multi properly in combination with the offline queue", function (done) {
var multi1 = client.multi();
multi1.set("m1", "123");
multi1.get('m1');
multi1.exec(done);
});
});
describe("when ready", function () {
var client;
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("ready", function () {
@@ -73,7 +93,7 @@ describe("The 'multi' method", function () {
assert.strictEqual(notBuffering, true);
});
it("runs normal calls inbetween multis", function (done) {
it("runs normal calls in-between multis", function (done) {
var multi1 = client.multi();
multi1.set("m1", "123");
client.set('m2', '456', done);