You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Fix send_command always returning should_buffer boolean
Fix .auth, .select and .exec to return the should_buffer boolean
This commit is contained in:
@@ -203,11 +203,12 @@ describe("The 'multi' method", function () {
|
||||
});
|
||||
|
||||
it('runs a multi without any further commands', function(done) {
|
||||
client.multi().exec(function(err, res) {
|
||||
var buffering = client.multi().exec(function(err, res) {
|
||||
assert.strictEqual(err, null);
|
||||
assert.strictEqual(res.length, 0);
|
||||
done();
|
||||
});
|
||||
assert(typeof buffering === 'boolean');
|
||||
});
|
||||
|
||||
it('allows multiple operations to be performed using a chaining API', function (done) {
|
||||
|
@@ -24,10 +24,11 @@ describe("The 'select' method", function () {
|
||||
});
|
||||
|
||||
it("returns an error if redis is not connected", function (done) {
|
||||
client.select(1, function (err, res) {
|
||||
var buffering = client.select(1, function (err, res) {
|
||||
assert(err.message.match(/The connection has already been closed/));
|
||||
done();
|
||||
});
|
||||
assert(typeof buffering === 'boolean');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -36,7 +37,7 @@ describe("The 'select' method", function () {
|
||||
|
||||
beforeEach(function (done) {
|
||||
client = redis.createClient.apply(redis.createClient, args);
|
||||
client.once("connect", function () { done(); });
|
||||
client.once("ready", function () { done(); });
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
@@ -46,11 +47,12 @@ describe("The 'select' method", function () {
|
||||
it("changes the database and calls the callback", function (done) {
|
||||
// default value of null means database 0 will be used.
|
||||
assert.strictEqual(client.selected_db, null, "default db should be null");
|
||||
client.SELECT(1, function (err, res) {
|
||||
var buffering = client.SELECT(1, function (err, res) {
|
||||
helper.isNotError()(err, res);
|
||||
assert.strictEqual(client.selected_db, 1, "db should be 1 after select");
|
||||
done();
|
||||
});
|
||||
assert(typeof buffering === 'boolean');
|
||||
});
|
||||
|
||||
describe("and a callback is specified", function () {
|
||||
|
@@ -29,7 +29,8 @@ describe("The 'setex' method", function () {
|
||||
});
|
||||
|
||||
it('returns an error if no value is provided', function (done) {
|
||||
client.SETEX(["setex key", "100", undefined], helper.isError(done));
|
||||
var buffering = client.SETEX(["setex key", "100", undefined], helper.isError(done));
|
||||
assert(typeof buffering === 'boolean');
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
|
Reference in New Issue
Block a user