|
|
|
@ -10,10 +10,11 @@ describe('pubsub', function () {
|
|
|
|
|
it('should use singleHostCluster', function (done) {
|
|
|
|
|
var oldValue = nconf.get('singleHostCluster');
|
|
|
|
|
nconf.set('singleHostCluster', true);
|
|
|
|
|
nconf.set('isCluster', true);
|
|
|
|
|
pubsub.on('testEvent', function (message) {
|
|
|
|
|
assert.equal(message.foo, 1);
|
|
|
|
|
nconf.set('singleHostCluster', oldValue);
|
|
|
|
|
|
|
|
|
|
nconf.set('isCluster', 'false');
|
|
|
|
|
pubsub.removeAllListeners('testEvent');
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
@ -23,9 +24,11 @@ describe('pubsub', function () {
|
|
|
|
|
it('should use the current database\'s pubsub', function (done) {
|
|
|
|
|
var oldValue = nconf.get('singleHostCluster');
|
|
|
|
|
nconf.set('singleHostCluster', false);
|
|
|
|
|
nconf.set('isCluster', true);
|
|
|
|
|
pubsub.on('testEvent', function (message) {
|
|
|
|
|
assert.equal(message.foo, 1);
|
|
|
|
|
nconf.set('singleHostCluster', oldValue);
|
|
|
|
|
nconf.set('isCluster', 'false');
|
|
|
|
|
pubsub.removeAllListeners('testEvent');
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|