Skip to content

Commit ff19663

Browse files
author
Ruben Bridgewater
committed
Remove code overhead
Add another domain test Fix test on node 0.10
1 parent f75b38a commit ff19663

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+127
-131
lines changed

test/auth.spec.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe("client authentication", function () {
3737
it("allows auth to be provided with 'auth' method", function (done) {
3838
if (helper.redisProcess().spawnFailed()) this.skip();
3939

40-
client = redis.createClient.apply(redis.createClient, args);
40+
client = redis.createClient.apply(null, args);
4141
client.auth(auth, function (err, res) {
4242
assert.strictEqual(null, err);
4343
assert.strictEqual("OK", res.toString());
@@ -48,7 +48,7 @@ describe("client authentication", function () {
4848
it("emits error when auth is bad without callback", function (done) {
4949
if (helper.redisProcess().spawnFailed()) this.skip();
5050

51-
client = redis.createClient.apply(redis.createClient, args);
51+
client = redis.createClient.apply(null, args);
5252

5353
client.once('error', function (err) {
5454
assert.strictEqual(err.command, 'AUTH');
@@ -62,7 +62,7 @@ describe("client authentication", function () {
6262
it("returns an error when auth is bad (empty string) with a callback", function (done) {
6363
if (helper.redisProcess().spawnFailed()) this.skip();
6464

65-
client = redis.createClient.apply(redis.createClient, args);
65+
client = redis.createClient.apply(null, args);
6666

6767
client.auth('', function (err, res) {
6868
assert.strictEqual(err.command, 'AUTH');
@@ -114,7 +114,7 @@ describe("client authentication", function () {
114114
var args = config.configureClient(parser, ip, {
115115
auth_pass: auth
116116
});
117-
client = redis.createClient.apply(redis.createClient, args);
117+
client = redis.createClient.apply(null, args);
118118
client.on("ready", function () {
119119
return done();
120120
});
@@ -127,7 +127,7 @@ describe("client authentication", function () {
127127
password: auth,
128128
no_ready_check: true
129129
});
130-
client = redis.createClient.apply(redis.createClient, args);
130+
client = redis.createClient.apply(null, args);
131131
client.on("ready", function () {
132132
done();
133133
});
@@ -137,7 +137,7 @@ describe("client authentication", function () {
137137
if (helper.redisProcess().spawnFailed()) this.skip();
138138

139139
var args = config.configureClient(parser, ip);
140-
client = redis.createClient.apply(redis.createClient, args);
140+
client = redis.createClient.apply(null, args);
141141
client.auth(auth);
142142
client.on("ready", function () {
143143
return done();
@@ -148,7 +148,7 @@ describe("client authentication", function () {
148148
if (helper.redisProcess().spawnFailed()) this.skip();
149149

150150
var readyCount = 0;
151-
client = redis.createClient.apply(redis.createClient, args);
151+
client = redis.createClient.apply(null, args);
152152
client.auth(auth);
153153
client.on("ready", function () {
154154
readyCount++;
@@ -163,7 +163,7 @@ describe("client authentication", function () {
163163
it('should return an error if the password is not of type string and a callback has been provided', function (done) {
164164
if (helper.redisProcess().spawnFailed()) this.skip();
165165

166-
client = redis.createClient.apply(redis.createClient, args);
166+
client = redis.createClient.apply(null, args);
167167
var async = true;
168168
client.auth(undefined, function(err, res) {
169169
assert.strictEqual(err.message, 'ERR invalid password');
@@ -178,7 +178,7 @@ describe("client authentication", function () {
178178
it('should emit an error if the password is not of type string and no callback has been provided', function (done) {
179179
if (helper.redisProcess().spawnFailed()) this.skip();
180180

181-
client = redis.createClient.apply(redis.createClient, args);
181+
client = redis.createClient.apply(null, args);
182182
client.on('error', function (err) {
183183
assert.strictEqual(err.message, 'ERR invalid password');
184184
assert.strictEqual(err.command, 'AUTH');
@@ -193,7 +193,7 @@ describe("client authentication", function () {
193193
var args = config.configureClient(parser, ip, {
194194
auth_pass: auth
195195
});
196-
client = redis.createClient.apply(redis.createClient, args);
196+
client = redis.createClient.apply(null, args);
197197
client.on("ready", function () {
198198
client.auth(auth, helper.isString('OK', done));
199199
});
@@ -205,7 +205,7 @@ describe("client authentication", function () {
205205
var args = config.configureClient(parser, ip, {
206206
no_ready_check: true
207207
});
208-
client = redis.createClient.apply(redis.createClient, args);
208+
client = redis.createClient.apply(null, args);
209209
client.on("ready", function () {
210210
client.set('foo', 'bar', function (err, res) {
211211
assert.equal(err.message, 'NOAUTH Authentication required.');
@@ -218,7 +218,7 @@ describe("client authentication", function () {
218218

219219
it('does not allow auth to be provided post-hoc with auth method if not authenticated before', function (done) {
220220
if (helper.redisProcess().spawnFailed()) this.skip();
221-
client = redis.createClient.apply(redis.createClient, args);
221+
client = redis.createClient.apply(null, args);
222222
client.on("error", function (err) {
223223
assert.equal(err.code, 'NOAUTH');
224224
assert.equal(err.message, 'Ready check failed: NOAUTH Authentication required.');

test/batch.spec.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ describe("The 'batch' method", function () {
2222
var client;
2323

2424
beforeEach(function (done) {
25-
client = redis.createClient.apply(redis.createClient, args);
25+
client = redis.createClient.apply(null, args);
2626
client.once("connect", function () {
2727
client.quit();
2828
});
29-
client.on('end', function () {
30-
return done();
31-
});
29+
client.on('end', done);
3230
});
3331

3432
it("returns an empty array", function (done) {
@@ -51,7 +49,7 @@ describe("The 'batch' method", function () {
5149
var client;
5250

5351
beforeEach(function (done) {
54-
client = redis.createClient.apply(redis.createClient, args);
52+
client = redis.createClient.apply(null, args);
5553
client.once("ready", function () {
5654
client.flushdb(function (err) {
5755
return done(err);

test/commands/blpop.spec.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ describe("The 'blpop' method", function () {
1515
var bclient;
1616

1717
beforeEach(function (done) {
18-
client = redis.createClient.apply(redis.createClient, args);
18+
client = redis.createClient.apply(null, args);
1919
client.once("ready", function () {
2020
client.flushdb(done);
2121
});
2222
});
2323

2424
it('pops value immediately if list contains values', function (done) {
25-
bclient = redis.createClient.apply(redis.createClient, args);
25+
bclient = redis.createClient.apply(null, args);
2626
redis.debug_mode = true;
2727
var text = '';
2828
var unhookIntercept = intercept(function(data) {
@@ -41,7 +41,7 @@ describe("The 'blpop' method", function () {
4141
});
4242

4343
it('pops value immediately if list contains values using array notation', function (done) {
44-
bclient = redis.createClient.apply(redis.createClient, args);
44+
bclient = redis.createClient.apply(null, args);
4545
client.rpush(["blocking list", "initial value"], helper.isNumber(1));
4646
bclient.blpop(["blocking list", 0], function (err, value) {
4747
assert.strictEqual(value[0], "blocking list");
@@ -51,7 +51,7 @@ describe("The 'blpop' method", function () {
5151
});
5252

5353
it('waits for value if list is not yet populated', function (done) {
54-
bclient = redis.createClient.apply(redis.createClient, args);
54+
bclient = redis.createClient.apply(null, args);
5555
bclient.blpop("blocking list 2", 5, function (err, value) {
5656
assert.strictEqual(value[0], "blocking list 2");
5757
assert.strictEqual(value[1], "initial value");
@@ -61,7 +61,7 @@ describe("The 'blpop' method", function () {
6161
});
6262

6363
it('times out after specified time', function (done) {
64-
bclient = redis.createClient.apply(redis.createClient, args);
64+
bclient = redis.createClient.apply(null, args);
6565
bclient.BLPOP("blocking list", 1, function (err, res) {
6666
assert.strictEqual(res, null);
6767
return done(err);

test/commands/client.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("The 'client' method", function () {
1414
var client;
1515

1616
beforeEach(function (done) {
17-
client = redis.createClient.apply(redis.createClient, args);
17+
client = redis.createClient.apply(null, args);
1818
client.once("ready", function () {
1919
client.flushdb(done);
2020
});

test/commands/dbsize.spec.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ describe("The 'dbsize' method", function () {
2222
var client;
2323

2424
beforeEach(function (done) {
25-
client = redis.createClient.apply(redis.createClient, args);
25+
client = redis.createClient.apply(null, args);
2626
client.once("ready", function () {
2727
client.quit();
2828
});
29-
client.on('end', function () {
30-
return done();
31-
});
29+
client.on('end', done);
3230
});
3331

3432
it("reports an error", function (done) {
@@ -43,7 +41,7 @@ describe("The 'dbsize' method", function () {
4341
var client;
4442

4543
beforeEach(function (done) {
46-
client = redis.createClient.apply(redis.createClient, args);
44+
client = redis.createClient.apply(null, args);
4745
client.once("ready", function () {
4846
client.flushdb(function (err, res) {
4947
helper.isString("OK")(err, res);

test/commands/del.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("The 'del' method", function () {
1212
var client;
1313

1414
beforeEach(function (done) {
15-
client = redis.createClient.apply(redis.createClient, args);
15+
client = redis.createClient.apply(null, args);
1616
client.once("ready", function () {
1717
client.flushdb(done);
1818
});

test/commands/eval.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("The 'eval' method", function () {
1515
var source = "return redis.call('set', 'sha', 'test')";
1616

1717
beforeEach(function (done) {
18-
client = redis.createClient.apply(redis.createClient, args);
18+
client = redis.createClient.apply(null, args);
1919
client.once("ready", function () {
2020
client.flushdb(done);
2121
});

test/commands/exists.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("The 'exists' method", function () {
1212
var client;
1313

1414
beforeEach(function (done) {
15-
client = redis.createClient.apply(redis.createClient, args);
15+
client = redis.createClient.apply(null, args);
1616
client.once("ready", function () {
1717
client.flushdb(done);
1818
});

test/commands/expire.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("The 'expire' method", function () {
1212
var client;
1313

1414
beforeEach(function (done) {
15-
client = redis.createClient.apply(redis.createClient, args);
15+
client = redis.createClient.apply(null, args);
1616
client.once("ready", function () {
1717
client.flushdb(done);
1818
});

test/commands/flushdb.spec.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ describe("The 'flushdb' method", function () {
2222
var client;
2323

2424
beforeEach(function (done) {
25-
client = redis.createClient.apply(redis.createClient, args);
25+
client = redis.createClient.apply(null, args);
2626
client.once("ready", function () {
2727
client.quit();
2828
});
29-
client.on('end', function () {
30-
return done();
31-
});
29+
client.on('end', done);
3230
});
3331

3432
it("reports an error", function (done) {
@@ -43,7 +41,7 @@ describe("The 'flushdb' method", function () {
4341
var client;
4442

4543
beforeEach(function (done) {
46-
client = redis.createClient.apply(redis.createClient, args);
44+
client = redis.createClient.apply(null, args);
4745
client.once("ready", function () {
4846
done();
4947
});

test/commands/geoadd.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("The 'geoadd' method", function () {
1212
var client;
1313

1414
beforeEach(function (done) {
15-
client = redis.createClient.apply(redis.createClient, args);
15+
client = redis.createClient.apply(null, args);
1616
client.once("ready", function () {
1717
client.flushdb(done);
1818
});

test/commands/get.spec.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ describe("The 'get' method", function () {
2222
var client;
2323

2424
beforeEach(function (done) {
25-
client = redis.createClient.apply(redis.createClient, args);
25+
client = redis.createClient.apply(null, args);
2626
client.once("ready", function () {
2727
client.quit();
2828
});
29-
client.on('end', function () {
30-
return done();
31-
});
29+
client.on('end', done);
3230
});
3331

3432
it("reports an error", function (done) {
@@ -49,7 +47,7 @@ describe("The 'get' method", function () {
4947
var client;
5048

5149
beforeEach(function (done) {
52-
client = redis.createClient.apply(redis.createClient, args);
50+
client = redis.createClient.apply(null, args);
5351
client.once("ready", function () {
5452
done();
5553
});

test/commands/getset.spec.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ describe("The 'getset' method", function () {
2323
var client;
2424

2525
beforeEach(function (done) {
26-
client = redis.createClient.apply(redis.createClient, args);
26+
client = redis.createClient.apply(null, args);
2727
client.once("ready", function () {
2828
client.quit();
2929
});
30-
client.on('end', function () {
31-
return done();
32-
});
30+
client.on('end', done);
3331
});
3432

3533
it("reports an error", function (done) {
@@ -44,7 +42,7 @@ describe("The 'getset' method", function () {
4442
var client;
4543

4644
beforeEach(function (done) {
47-
client = redis.createClient.apply(redis.createClient, args);
45+
client = redis.createClient.apply(null, args);
4846
client.once("ready", function () {
4947
done();
5048
});

test/commands/hgetall.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("The 'hgetall' method", function () {
1515
describe('regular client', function () {
1616

1717
beforeEach(function (done) {
18-
client = redis.createClient.apply(redis.createClient, args);
18+
client = redis.createClient.apply(null, args);
1919
client.once("ready", function () {
2020
client.flushdb(done);
2121
});
@@ -56,7 +56,7 @@ describe("The 'hgetall' method", function () {
5656
});
5757

5858
beforeEach(function (done) {
59-
client = redis.createClient.apply(redis.createClient, args);
59+
client = redis.createClient.apply(null, args);
6060
client.once("ready", function () {
6161
client.flushdb(done);
6262
});

test/commands/hincrby.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe("The 'hincrby' method", function () {
1313
var hash = "test hash";
1414

1515
beforeEach(function (done) {
16-
client = redis.createClient.apply(redis.createClient, args);
16+
client = redis.createClient.apply(null, args);
1717
client.once("ready", function () {
1818
client.flushdb(done);
1919
});

test/commands/hlen.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("The 'hlen' method", function () {
1212
var client;
1313

1414
beforeEach(function (done) {
15-
client = redis.createClient.apply(redis.createClient, args);
15+
client = redis.createClient.apply(null, args);
1616
client.once("ready", function () {
1717
client.flushdb(done);
1818
});

test/commands/hmget.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("The 'hmget' method", function () {
1414
var hash = 'test hash';
1515

1616
beforeEach(function (done) {
17-
client = redis.createClient.apply(redis.createClient, args);
17+
client = redis.createClient.apply(null, args);
1818
client.once("error", done);
1919
client.once("ready", function () {
2020
client.flushdb();

test/commands/hmset.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("The 'hmset' method", function () {
1414
var hash = 'test hash';
1515

1616
beforeEach(function (done) {
17-
client = redis.createClient.apply(redis.createClient, args);
17+
client = redis.createClient.apply(null, args);
1818
client.once("ready", function () {
1919
client.flushdb(done);
2020
});

test/commands/hset.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("The 'hset' method", function () {
1414
var hash = 'test hash';
1515

1616
beforeEach(function (done) {
17-
client = redis.createClient.apply(redis.createClient, args);
17+
client = redis.createClient.apply(null, args);
1818
client.once("ready", function () {
1919
client.flushdb(done);
2020
});

0 commit comments

Comments
 (0)