Sha256: 9231cc35956661918b7d3a97de60b40182bf92e532f64b6b15d944552e598daf
Contents?: true
Size: 1.21 KB
Versions: 58
Compression:
Stored size: 1.21 KB
Contents
require 'mocha/expectation_error' module Mocha module TestCaseAdapter def self.included(base) base.class_eval do alias_method :run_before_mocha_test_case_adapter, :run def run(result) yield(Test::Unit::TestCase::STARTED, name) @_result = result begin mocha_setup begin setup __send__(@method_name) mocha_verify { add_assertion } rescue Mocha::ExpectationError => e add_failure(e.message, e.backtrace) rescue Test::Unit::AssertionFailedError => e add_failure(e.message, e.backtrace) rescue StandardError, ScriptError add_error($!) ensure begin teardown rescue Test::Unit::AssertionFailedError => e add_failure(e.message, e.backtrace) rescue StandardError, ScriptError add_error($!) end end ensure mocha_teardown end result.add_run yield(Test::Unit::TestCase::FINISHED, name) end end end end end
Version data entries
58 entries across 58 versions & 6 rubygems