Sha256: e3eef3c38a1a404c2ccc7480eda88dba3152e975f9c3c49a79f38407f5b04730

Contents?: true

Size: 1.39 KB

Versions: 15

Compression:

Stored size: 1.39 KB

Contents

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

module Mocha
  
  module Integration
    
    module TestUnit
      
      module RubyVersion186AndAbove
        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 Exception
              raise if Test::Unit::TestCase::PASSTHROUGH_EXCEPTIONS.include? $!.class
              add_error($!)
            ensure
              begin
                teardown
              rescue Test::Unit::AssertionFailedError => e
                add_failure(e.message, e.backtrace)
              rescue Exception
                raise if Test::Unit::TestCase::PASSTHROUGH_EXCEPTIONS.include? $!.class
                add_error($!)
              end
            end
          ensure
            mocha_teardown
          end
          result.add_run
          yield(Test::Unit::TestCase::FINISHED, name)
        end
      end
      
    end
    
  end
  
end

Version data entries

15 entries across 15 versions & 5 rubygems

Version Path
floehopper-mocha-0.9.6.20090629164857 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
floehopper-mocha-0.9.6.20090629165308 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
floehopper-mocha-0.9.6.20090701111305 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
floehopper-mocha-0.9.7.20090701124354 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
jferris-mocha-0.9.5.0.1240002286 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
jferris-mocha-0.9.5.0.1240351621 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
jferris-mocha-0.9.5.0.1241126838 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
jferris-mocha-0.9.7.0.1247796736 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
jferris-mocha-0.9.7.20090701124354 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
jferris-mocha-0.9.7.20090911190113 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
mocha-macruby-0.9.8.20100129120100 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
mcmire-mocha-0.9.8 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
mocha-0.9.8 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
mocha-0.9.6 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
mocha-0.9.7 lib/mocha/integration/test_unit/ruby_version_186_and_above.rb