Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix for #149

  • Loading branch information...
commit 326439e66fbca8727d7dc545e3916411a1b04a2b 1 parent 292a4b0
@nibblebot nibblebot authored tj committed
Showing with 33 additions and 1 deletion.
  1. +1 −1  lib/master.js
  2. +32 −0 test/test.cli-status.js
View
2  lib/master.js
@@ -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) {
View
32 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();
+});
Please sign in to comment.
Something went wrong with that request. Please try again.