1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +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:
Ruben Bridgewater
2015-10-05 11:16:24 +02:00
parent e47ba4a583
commit 146d88154c
5 changed files with 24 additions and 18 deletions

View File

@@ -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 () {