Methods

Class/Module Index [+]

Quicksearch

Mocha::Integration::TestUnit::GemVersion203To220

Public Class Methods

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

Public Instance Methods

run(result) click to toggle source
# File lib/mocha/integration/test_unit/gem_version_203_to_220.rb, line 15
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

[Validate]

Generated with the Darkfish Rdoc Generator 2.