-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the files I missed in a previous commit.
- Loading branch information
1 parent
039e3dc
commit 40639a6
Showing
4 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
child_process = require 'child_process' | ||
|
||
exports.execute = (command) -> | ||
child_process.spawn '/bin/sh', ['-c', command], customFds: [0, 0, 0] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require('jessie').sugar() | ||
require('coffee-script'); | ||
|
||
// More sugar | ||
any = jasmine.any | ||
stub = jasmine.createSpy | ||
stubObj = jasmine.createSpyObj | ||
noop = function() {/*NoOp*/} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
WRITEBOARD_SERVER = '../../lib/server' | ||
|
||
describe 'The Writeboard server', -> | ||
beforeEach -> | ||
@webAppMock = stubObj 'webAppMock', ['configure', 'listen'] | ||
@expressMock = createServer: noop | ||
spyOn(@expressMock, 'createServer').andReturn @webAppMock | ||
|
||
it 'should create an Express web application', -> | ||
require(WRITEBOARD_SERVER) @expressMock | ||
@expressMock.createServer.should_have_been_called() | ||
|
||
it 'should be configured', -> | ||
require(WRITEBOARD_SERVER) @expressMock | ||
@webAppMock.configure.should_have_been_called_with any Function | ||
|
||
it 'should listen on port 9796', -> | ||
require(WRITEBOARD_SERVER) @expressMock | ||
@webAppMock.listen.should_have_been_called_with 9796 | ||
|
||
it 'should initialize the controllers', -> | ||
controllerOne = stub 'controllerOne' | ||
controllerTwo = stub 'controllerTwo' | ||
nowJsStub = stub 'nowJs' | ||
|
||
require(WRITEBOARD_SERVER) @expressMock, (stub 'stylus'), (stub 'nib'), nowJsStub, | ||
controllerOne, controllerTwo | ||
controllerOne.should_have_been_called_with @webAppMock, nowJsStub | ||
controllerTwo.should_have_been_called_with @webAppMock, nowJsStub | ||
|