Created
November 28, 2011 17:43
-
-
Save GraemeF/1401254 to your computer and use it in GitHub Desktop.
vows-bdd
This file contains hidden or 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
| {Feature} = require "vows-bdd" | |
| vows = require 'vows' | |
| assert = require 'assert' | |
| Feature("Share stuff between steps", module) | |
| .scenario("Set properties on given and when") | |
| .given "A is set", -> | |
| @A = "A" | |
| @callback() | |
| .when "I set B", -> | |
| @B = "B" | |
| @callback() | |
| .then "A should still be set", -> | |
| assert.equal @A, "A" | |
| .and "B should still be set", -> | |
| assert.equal @B, "B" | |
| .complete() | |
| .finish(module) |
Author
That's great - so basically "don't do that" :)
Thanks again!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check out my fork. The reason why process.nextTick wasn't working was that the vows
contextwasn't being applied properly. There's some magic under the vows covers; it's continuously usingfn.applyto keepthispointing at the vows context properly, and callingprocess.nextTick @callbackdirectly causes a problem there. You can verify the different behaviors by droppingconsole.log thisin thethenblocks