class Bacon::Specification

def execute_block

def execute_block
  execute_block_before_mocha do
    begin
      yield
    rescue Mocha::ExpectationError => e
      raise Error.new(:failed, e.message).tap {|ne| ne.set_backtrace(e.backtrace) }
    end
  end
end

def finalize

def finalize
  # If an exception already occurred, we don't need to verify Mocha
  # expectations anymore, as the test has already failed.
  unless @exception_occurred
    execute_block { @context.mocha_verify(MochaRequirementsCounter) }
  end
  @context.mocha_teardown
  finalize_before_mocha
end

def run

def run
  @context.mocha_setup
  run_before_mocha
end