Skip to content

Commit

Permalink
Adding the files I missed in a previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
gtramontina committed Jun 29, 2011
1 parent 039e3dc commit 40639a6
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ build/test_results/*
node_modules/

# Compiled css and js (from and stylus and coffeescript)
public/stylesheets/*.css
public/javascripts/*.js
lib/public/stylesheets/*.css
lib/public/javascripts/*.js

# Node.js monitor module
nodemon-ignore
Expand All @@ -24,3 +24,4 @@ nodemon-ignore

#ignoring selenium.jar
selenium-server.jar

5 changes: 5 additions & 0 deletions build/lib/buildHelper.coffee
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]

9 changes: 9 additions & 0 deletions spec/spec_helper.js
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*/}

30 changes: 30 additions & 0 deletions spec/unit/server_spec.coffee
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

0 comments on commit 40639a6

Please sign in to comment.