Skip to content

Commit

Permalink
Fix tests for pubsub
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Sep 30, 2015
1 parent 61be901 commit 1d36168
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/functional/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,19 @@ describe('connection', function () {
pub.lpush('l', 1);
});
});

it('should resend previous subscribes before sending unfulfilled commands', function (done) {
var redis = new Redis({ db: 4 });
var pub = new Redis({ db: 4 });
redis.once('ready', function () {
redis.subscribe('l', function() {
redis.disconnect(true);
redis.unsubscribe('l', function() {
pub.pubsub('channels', function(err, channels){
expect(channels.length).to.eql(0);
done();
pub.pubsub('channels', function(err, channelsBefore){
redis.subscribe('l', function() {
redis.disconnect(true);
redis.unsubscribe('l', function() {
pub.pubsub('channels', function(err, channels){
expect(channels.length).to.eql(channelsBefore.length);
done();
});
});
});
});
Expand Down

0 comments on commit 1d36168

Please sign in to comment.