Skip to content

Instantly share code, notes, and snippets.

@robashton
Created June 28, 2012 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robashton/3010659 to your computer and use it in GitHub Desktop.
Save robashton/3010659 to your computer and use it in GitHub Desktop.
hmm.coffee
Scenario "Bootstrapping the game", ->
context = new ManualContext()
bob = null
alice = null
Given "a server in a ready state", (done) ->
context.start(done)
When "bob connects", (cb) ->
bob = context.add_client_called 'bob', cb
Then "bob should have a canvas displayed", ->
bob.should_have_element('canvas')
Then "bob should be told he is the only one", ->
bob.value_of('#client-count').should.include('only player')
When "alice connects", (cb) ->
alice = context.add_client_called 'alice', cb
Then "alice should have a canvas displayed", ->
alice.should_have_element('canvas')
Then "alice should be told there are two players", ->
alice.value_of('#client-count').should.include('2 players')
Then "bob should be told there are two players", ->
bob.value_of('#client-count').should.include('2 players')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment