Methods

Class Index [+]

Quicksearch

Mocha::Integration::TestUnit::GemVersion230To240

Public Class Methods

included(mod) click to toggle source
    # File lib/mocha/integration/test_unit/gem_version_230_to_240.rb, line 12
12:         def self.included(mod)
13:           $stderr.puts "Monkey patching Test::Unit gem >= v2.3.0 and <= v2.4.0" if $mocha_options['debug']
14:         end

Public Instance Methods

run(result) click to toggle source
    # File lib/mocha/integration/test_unit/gem_version_230_to_240.rb, line 15
15:         def run(result)
16:           assertion_counter = AssertionCounter.new(result)
17:           begin
18:             @internal_data.test_started
19:             @_result = result
20:             yield(Test::Unit::TestCase::STARTED, name)
21:             yield(Test::Unit::TestCase::STARTED_OBJECT, self)
22:             begin
23:               begin
24:                 run_setup
25:                 run_test
26:                 run_cleanup
27:                 mocha_verify(assertion_counter)
28:                 add_pass
29:               rescue Mocha::ExpectationError => e
30:                 add_failure(e.message, e.backtrace)
31:               rescue Exception
32:                 @internal_data.interrupted
33:                 raise unless handle_exception($!)
34:               ensure
35:                 begin
36:                   run_teardown
37:                 rescue Exception
38:                   raise unless handle_exception($!)
39:                 end
40:               end
41:             ensure
42:               mocha_teardown
43:             end
44:             @internal_data.test_finished
45:             result.add_run
46:             yield(Test::Unit::TestCase::FINISHED, name)
47:             yield(Test::Unit::TestCase::FINISHED_OBJECT, self)
48:           ensure
49:             # @_result = nil # For test-spec's after_all :<
50:           end
51:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.