Skip to content

Instantly share code, notes, and snippets.

@manveru
Created June 18, 2010 16:14
Show Gist options
  • Save manveru/443842 to your computer and use it in GitHub Desktop.
Save manveru/443842 to your computer and use it in GitHub Desktop.
Bacon: {
contexts: []
errors: []
}
Bacon.describe: (name, context) ->
@contexts.push([name, context])
assume: (code) ->
if code() isnt true
throw("Assertion failed:\n$code")
Bacon.report: ->
for [name, context] in @contexts
try
context()
catch error
@errors.push(error)
for error in @errors
puts(error)
Bacon.describe "Describe blocks", ->
assume -> "hi there" is "hi there"
assume -> "i there" is "hi there"
Bacon.report()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment