Skip to content
Browse files

pass jsgi options to bogart.start from bogart.app.start

  • Loading branch information...
1 parent fc6d21f commit 38eb60ff6e654f3ae2692238f0efc914bfbe32a3 @rhino-security rhino-security committed Feb 11, 2013
Showing with 5 additions and 4 deletions.
  1. +2 −2 lib/bogart.js
  2. +3 −2 test/app.test.js
View
4 lib/bogart.js
@@ -133,10 +133,10 @@ App.prototype.start = function(port, host, jsgiOpts) {
});
}
- var server = exports.start(app, {
+ var server = exports.start(app, require('./util').merge({
port: port || 8080,
host: host || '127.0.0.1'
- });
+ }, jsgiOpts));
this.started = true;
this.emit('afterStart', this, server);
View
5 test/app.test.js
@@ -85,7 +85,7 @@ test('given a new app with a router to be started with object parameter', functi
});
t.test('starting the app', function(t) {
- var opts = { port: 123, host: 'localhost' }
+ var opts = { port: 123, host: 'localhost', somethingElse: 'anotherOption' }
, server = {}
, jsgiOptsFromSpy
, bogartStartSpy = sinon.stub(bogart, 'start', function(jsgiApp, opts) {
@@ -100,9 +100,10 @@ test('given a new app with a router to be started with object parameter', functi
t.test('should have started with correct jsgi options parameter', function(t) {
t.equal(jsgiOptsFromSpy.port, 123);
t.equal(jsgiOptsFromSpy.host, 'localhost');
+ t.equal(jsgiOptsFromSpy.somethingElse, 'anotherOption');
t.end();
});
t.end();
});
-});
+});

0 comments on commit 38eb60f

Please sign in to comment.
Something went wrong with that request. Please try again.