Skip to content

Instantly share code, notes, and snippets.

@nicolaracco
Created December 2, 2013 10:03
Show Gist options
  • Save nicolaracco/7747397 to your computer and use it in GitHub Desktop.
Save nicolaracco/7747397 to your computer and use it in GitHub Desktop.
# app.coffee
require 'express'
class Server
constructor: ->
@app = express()
@server = http.createServer(@app)
@io = SocketIO.listen @server, logger: @logger
@configure_app()
start: (done) =>
@server.listen 3000
done?()
stop: (done) =>
@server.stop done
configure_app: =>
...
# spec/requests/login_page_spec.coffee
Server = require '../../app'
describe 'Login Page', ->
beforeAll (done) ->
@server = new Server
@server.start done
...
afterAll (done) ->
@server.stop done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment