Sha256: fa4c52f328a046596428d013855c8980eab85cf3106b9dbf46aeecd55ce46f03

Contents?: true

Size: 1.33 KB

Versions: 14

Compression:

Stored size: 1.33 KB

Contents

require 'test/unit/testcase'
require 'mocha/integration/test_unit/assertion_counter'
require 'mocha/expectation_error'

module Mocha
  
  module Integration
    
    module TestUnit
      
      module GemVersion200
        def self.included(mod)
          $stderr.puts "Monkey patching Test::Unit gem v2.0.0" if $mocha_options['debug']
        end
        def run(result)
          assertion_counter = AssertionCounter.new(result)
          begin
            @_result = result
            yield(Test::Unit::TestCase::STARTED, name)
            begin
              begin
                run_setup
                __send__(@method_name)
                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
          end
        end
      end
      
    end
    
  end
  
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
challah-1.0.0.beta vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
challah-0.9.1.beta.3 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
devise_sociable-0.1.0 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
challah-0.9.1.beta vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
challah-0.9.0 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
challah-0.6.2 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
challah-0.6.1 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
challah-0.6.0 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
challah-0.5.4 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
challah-0.5.3 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
challah-0.5.2 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
challah-0.5.1 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration/test_unit/gem_version_200.rb
mocha-0.10.5 lib/mocha/integration/test_unit/gem_version_200.rb
mocha-0.10.4 lib/mocha/integration/test_unit/gem_version_200.rb