Skip to content

Commit

Permalink
Merge pull request #796 from NodeRedis/753-example
Browse files Browse the repository at this point in the history
added test for psubscribe
  • Loading branch information
bcoe committed Aug 17, 2015
2 parents e2e507e + d1558ed commit 323d6a2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/pubsub.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,20 @@ describe("publish/subscribe", function () {
});
});

describe('psubscribe', function () {
// test motivated by issue #753
it('allows all channels to be subscribed to using a * pattern', function (done) {
sub.psubscribe('*');
sub.on("pmessage", function(pattern, channel, message) {
assert.strictEqual(pattern, '*');
assert.strictEqual(channel, '/foo');
assert.strictEqual(message, 'hello world');
return done();
})
pub.publish('/foo', 'hello world');
});
});

describe('punsubscribe', function () {
it('does not complain when punsubscribe is called and there are no subscriptions', function () {
sub.punsubscribe()
Expand Down

0 comments on commit 323d6a2

Please sign in to comment.