Skip to content

Commit

Permalink
fix for LearnBoost#149
Browse files Browse the repository at this point in the history
  • Loading branch information
nibblebot committed Sep 19, 2011
1 parent 292a4b0 commit 401c940
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/master.js
Expand Up @@ -235,7 +235,7 @@ Master.prototype.start = function(fn){
process.title = this.options.title;

// prevent listen
if (this.preventDefault) return;
if (this.preventDefault) return this;

// env match
if (this.environmentMatches) {
Expand Down
32 changes: 32 additions & 0 deletions test/test.cli-status.js
@@ -0,0 +1,32 @@

/**
* Module dependencies.
*/

var cluster = require('../')
, http = require('http')
, fs = require('fs')
, Master = require('../lib/master.js');

require('./common');

var server = http.createServer(function(req, res){
setTimeout(function(){
res.writeHead(200);
res.end('Hello World');
}, 1000);
});

cluster = cluster(server)
.set('workers', 1)
.use(cluster.pidfiles())
.use(cluster.cli())
.in('development').listen(3000)
.in('staging').listen(3010);


cluster.on('listening', function(){
cluster.preventDefault = true;
cluster.start().should.be.an.instanceof(Master);
cluster.close();
});

0 comments on commit 401c940

Please sign in to comment.