included (Mocha::TestCaseAdapter)

        # File lib/mocha/test_case_adapter.rb, line 19
    19:     def self.included(base)
    20:       if RUBY_VERSION < '1.8.6'
    21:         base.class_eval do
    22:
    23:           alias_method :run_before_mocha_test_case_adapter, :run
    24:
    25:           def run(result)
    26:             assertion_counter = AssertionCounter.new(result)
    27:             yield(Test::Unit::TestCase::STARTED, name)
    28:             @_result = result
    29:             begin
    30:               begin
    31:                 setup
    32:                 __send__(@method_name)
    33:                 mocha_verify(assertion_counter)
    34:               rescue Mocha::ExpectationError => e
    35:                 add_failure(e.message, e.backtrace)
    36:               rescue Test::Unit::AssertionFailedError => e
    37:                 add_failure(e.message, e.backtrace)
    38:               rescue StandardError, ScriptError
    39:                 add_error($!)
    40:               ensure
    41:                 begin
    42:                   teardown
    43:                 rescue Test::Unit::AssertionFailedError => e
    44:                   add_failure(e.message, e.backtrace)
    45:                 rescue StandardError, ScriptError
    46:                   add_error($!)
    47:                 end
    48:               end
    49:             ensure
    50:               mocha_teardown
    51:             end
    52:             result.add_run
    53:             yield(Test::Unit::TestCase::FINISHED, name)
    54:           end
    55:
    56:         end
    57:       else
    58:         base.class_eval do
    59:
    60:           alias_method :run_before_mocha_test_case_adapter, :run
    61:
    62:           def run(result)
    63:             assertion_counter = AssertionCounter.new(result)
    64:             yield(Test::Unit::TestCase::STARTED, name)
    65:             @_result = result
    66:             begin
    67:               begin
    68:                 setup
    69:                 __send__(@method_name)
    70:                 mocha_verify(assertion_counter)
    71:               rescue Mocha::ExpectationError => e
    72:                 add_failure(e.message, e.backtrace)
    73:               rescue Test::Unit::AssertionFailedError => e
    74:                 add_failure(e.message, e.backtrace)
    75:               rescue Exception
    76:                 raise if Test::Unit::TestCase::PASSTHROUGH_EXCEPTIONS.include? $!.class
    77:                 add_error($!)
    78:               ensure
    79:                 begin
    80:                   teardown
    81:                 rescue Test::Unit::AssertionFailedError => e
    82:                   add_failure(e.message, e.backtrace)
    83:                 rescue Exception
    84:                   raise if Test::Unit::TestCase::PASSTHROUGH_EXCEPTIONS.include? $!.class
    85:                   add_error($!)
    86:                 end
    87:               end
    88:             ensure
    89:               mocha_teardown
    90:             end
    91:             result.add_run
    92:             yield(Test::Unit::TestCase::FINISHED, name)
    93:           end
    94:
    95:         end
    96:
    97:       end
    98:
    99:     end