Created
January 13, 2012 13:15
-
-
Save petrjanda/1606059 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// APP | |
var http = require('http'); | |
module.exports = App = function() {} | |
App.prototype.init = function(options) { | |
// handle options | |
this.server = http.createServer(...) | |
} | |
// TEST | |
var http = require('http'), | |
App = require('./app'); | |
describe('App', function() { | |
var app; | |
beforeEach(function() { | |
app = new App(); | |
}) | |
describe('.init', function() { | |
it('should create http server', function() { | |
spyOn(http, 'createServer'); | |
app.init({port: 3000}); | |
expect(http.createServer).toHaveBeenCalledWith(...) | |
}) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment