Methods

Class/Module Index [+]

Quicksearch

Mocha::Integration::TestUnit::RubyVersion185AndBelow

Public Class Methods

included(mod) click to toggle source
# File lib/mocha/integration/test_unit/ruby_version_185_and_below.rb, line 12
def self.included(mod)
  $stderr.puts "Monkey patching Test::Unit for Ruby <= v1.8.5" if $options['debug']
end

Public Instance Methods

run(result) click to toggle source
# File lib/mocha/integration/test_unit/ruby_version_185_and_below.rb, line 15
def run(result)
  assertion_counter = AssertionCounter.new(result)
  yield(Test::Unit::TestCase::STARTED, name)
  @_result = result
  begin
    begin
      setup
      __send__(@method_name)
      mocha_verify(assertion_counter)
    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

[Validate]

Generated with the Darkfish Rdoc Generator 2.