Permalink
Browse files

Fixed some Readme examples as well as added a note about async testing.

  • Loading branch information...
1 parent d5a381d commit 3ba58da7b3395f61acc02005dddcd17df1e48b41 @quangv committed Jun 3, 2012
Showing with 12 additions and 3 deletions.
  1. +12 −3 Readme.md
View
15 Readme.md
@@ -107,8 +107,7 @@ Feature "New Feature",
When "I sing", ->
voice = 'good'
Then "it should sound good", ->
- it 'sound good', ->
- voice.should.eql 'good'
+ voice.should.eql 'good'
```
@@ -182,7 +181,7 @@ Feature "Big Buttons",
Then "I see big buttons", ->
But "no small text", ->
- Given -> # Previous
+ Given -> # Describe
When "I scroll down more", ->
And "I reach end of page", ->
Then "all I see is big buttons", ->
@@ -211,6 +210,16 @@ Feature "Mix & Match" ->
true.should.be true
```
+Note you can also test asynchronous code with Mocha-Cakes passing a callback argument to any GWTabi command. (`done` for example)
+
+```
+Feature "Async tests with Mocha-Cakes", ->
+ Given "I want to test async code", ->
+ When "I pass 'done' to GWT commands", ->
+ Then "It should wait for 'done' to be done.", (done)->
+ done()
+```
+
## Reference
[The WHY behind TDD/BDD and the HOW with RSpec](http://www.slideshare.net/bmabey/the-why-behind-tddbdd-and-the-how-with-rspec)

0 comments on commit 3ba58da

Please sign in to comment.