Skip to content

Instantly share code, notes, and snippets.

@nickhoffman
Created May 5, 2012 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nickhoffman/2599469 to your computer and use it in GitHub Desktop.
Save nickhoffman/2599469 to your computer and use it in GitHub Desktop.
The first context
Creating Person with name Nick
✗ Errored » callback not fired
in Create a Person via JavaScript: When a person has a name,
in Creating a Person
in undefined✗ Errored » 1 errored ∙ 1 dropped
vows_bdd = require "vows-bdd"
assert = require "assert"
class Person
constructor: (@name) ->
console.log "Creating Person with name #{@name}"
greeting: ->
"Hello, #{@name}"
vows_bdd
.Feature("Creating a Person")
.scenario("Create a Person via JavaScript")
.when "a person has a name", ->
console.log "The first context"
new Person "Nick"
.then "the person can be greeted", (person) ->
console.log "person is a #{typeof person} = [#{person}]"
assert.equal person.greeting(), "Hello, Nick"
.complete()
.finish(module)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment