Skip to content

Instantly share code, notes, and snippets.

@jmreidy
Forked from GraemeF/gist:1401254
Created November 28, 2011 18:03
Show Gist options
  • Save jmreidy/1401332 to your computer and use it in GitHub Desktop.
Save jmreidy/1401332 to your computer and use it in GitHub Desktop.
vows-bdd
{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"
ctx = this
process.nextTick ->
ctx.callback()
.when "I set B", ->
@B = "B"
ctx = this
process.nextTick ->
ctx.callback()
.then "A should still be set", ->
assert.equal @A, "A"
.and "B should still be set", ->
assert.equal @B, "B"
.complete()
.finish(module)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment