Sha256: a181e014302ffb5e13c842d863cd9aa1a7d6b1d92b7ae9ee75472a4c0dd15197
Contents?: true
Size: 1.34 KB
Versions: 20
Compression:
Stored size: 1.34 KB
Contents
require 'test/unit/testcase' require 'mocha/integration/test_unit/assertion_counter' require 'mocha/expectation_error' module Mocha module Integration module TestUnit module GemVersion203To220 def self.included(mod) $stderr.puts "Monkey patching Test::Unit gem >= v2.0.3 and <= v2.2.0" 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
20 entries across 20 versions & 2 rubygems