Class: Bacon::Context
- Inherits:
-
Object
- Object
- Bacon::Context
- Includes:
- Mocha::API
- Defined in:
- lib/mocha-on-bacon.rb,
lib/mocha-on-bacon.rb
Instance Method Summary collapse
Instance Method Details
#it(description, &block) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/mocha-on-bacon.rb', line 53 def it(description, &block) it_before_mocha(description) do begin mocha_setup block.call mocha_verify(MochaRequirementsCounter) rescue Mocha::ExpectationError => e raise Error.new(:failed, e.).tap {|ne| ne.set_backtrace(e.backtrace) } ensure mocha_teardown end end end |
#it_before_mocha ⇒ Object
52 |
# File 'lib/mocha-on-bacon.rb', line 52 alias_method :it_before_mocha, :it |