Sha256: c9f3870c3218071084d297256a3f9d4421df01bb6b49f2476a26f3c6fd1b6ac6
Contents?: true
Size: 1.36 KB
Versions: 6
Compression:
Stored size: 1.36 KB
Contents
require 'test/unit/testcase' require 'mocha/integration/test_unit/assertion_counter' require 'mocha/expectation_error' module Mocha module Integration module TestUnit module GemVersion203To209 def self.included(mod) $stderr.puts "Monkey patching Test::Unit gem >= v2.0.3 and <= v2.0.9" if $options['debug'] end def run(result) assertion_counter = AssertionCounter.new(result) begin @_result = result yield(Test::Unit::TestCase::STARTED, name) begin begin run_setup run_test mocha_verify(assertion_counter) rescue Mocha::ExpectationError => e add_failure(e.message, e.backtrace) rescue Exception @interrupted = true raise unless handle_exception($!) ensure begin run_teardown rescue Exception raise unless handle_exception($!) end end ensure mocha_teardown end result.add_run yield(Test::Unit::TestCase::FINISHED, name) ensure # @_result = nil # For test-spec's after_all :< end end end end end end
Version data entries
6 entries across 6 versions & 3 rubygems