Skip to content

Instantly share code, notes, and snippets.

@nerdyc
Created June 14, 2010 04:09
Show Gist options
  • Save nerdyc/437264 to your computer and use it in GitHub Desktop.
Save nerdyc/437264 to your computer and use it in GitHub Desktop.
# Tell MacRuby where to find our framework. Use BUILT_PRODUCTS_DIR if set, otherwise look for a build/ or ../build/
# directory
ENV['DYLD_FRAMEWORK_PATH'] =
[ENV['BUILT_PRODUCTS_DIR'], "#{File.dirname(__FILE__)}/build/Debug", "#{File.dirname(__FILE__)}/../build/Debug"].detect do |path|
!path.nil? && File.exist?(path)
end
# Include the Bacon libraries
require "rubygems"
require "bacon"
# Integrate Mocha into Bacon
require "mocha/standalone"
require "mocha/object"
class Bacon::Context
include Mocha::API
alias_method :old_it,:it
def it(description,&block)
mocha_setup
old_it(description,&block)
mocha_verify
mocha_teardown
end
end
# Setup Bacon to report on tests at the end
Bacon.summary_on_exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment