Skip to content

Instantly share code, notes, and snippets.

@rsanheim
Created July 29, 2008 06:53
Show Gist options
  • Save rsanheim/3034 to your computer and use it in GitHub Desktop.
Save rsanheim/3034 to your computer and use it in GitHub Desktop.
# This gets mocha and bacon playing together, but there needs to be a hack in mocha as well
# See the open issue here:
# http://groups.google.com/group/mocha-developer/browse_thread/thread/2ac239561ef07b23
require 'bacon'
require "mocha/standalone"
require "mocha/object"
class Bacon::Context
include Mocha::Standalone
def initialize(name, &block)
@name = name
@before, @after = [lambda { mocha_setup }], [lambda { mocha_verify }, lambda { mocha_teardown }]
# return unless name =~ RestrictContext
Bacon.handle_specification(name) { instance_eval(&block) }
end
end
Bacon.summary_on_exit # if you want test unit style output on exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment