Created
June 28, 2012 10:55
-
-
Save robashton/3010659 to your computer and use it in GitHub Desktop.
hmm.coffee
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
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