Sha256: 4b480130fc0972f51393b2eb9221b2d77b1439de743afa1aafdaf11212b32b33

Contents?: true

Size: 1000 Bytes

Versions: 53

Compression:

Stored size: 1000 Bytes

Contents

module Mocha
  
  module Integration
    
    class << self
    
      def monkey_patches
        patches = []
        if test_unit_testcase_defined? && !test_unit_testcase_inherits_from_miniunit_testcase?
          patches << 'mocha/integration/test_unit'
        end
        if mini_unit_testcase_defined?
          patches << 'mocha/integration/mini_test'
        end
        patches
      end
      
      def test_unit_testcase_defined?
        defined?(Test) && defined?(Test::Unit) && defined?(Test::Unit::TestCase)
      end
      
      def mini_unit_testcase_defined?
        defined?(MiniTest) && defined?(MiniTest::Unit) && defined?(MiniTest::Unit::TestCase)
      end
      
      def test_unit_testcase_inherits_from_miniunit_testcase?
        test_unit_testcase_defined? && mini_unit_testcase_defined? && Test::Unit::TestCase.ancestors.include?(MiniTest::Unit::TestCase)
      end
      
    end
    
  end
  
end

Mocha::Integration.monkey_patches.each do |patch|
  require patch
end

Version data entries

53 entries across 48 versions & 8 rubygems

Version Path
floehopper-mocha-0.9.6.20090629164857 lib/mocha/integration.rb
floehopper-mocha-0.9.6.20090629165308 lib/mocha/integration.rb
floehopper-mocha-0.9.6.20090701111305 lib/mocha/integration.rb
floehopper-mocha-0.9.7.20090701124354 lib/mocha/integration.rb
jferris-mocha-0.9.7.0.1247796736 lib/mocha/integration.rb
jferris-mocha-0.9.7.20090701124354 lib/mocha/integration.rb
jferris-mocha-0.9.7.20090911190113 lib/mocha/integration.rb
challah-1.0.0.beta vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration.rb
challah-0.9.1.beta.3 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration.rb
devise_sociable-0.1.0 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration.rb
challah-0.9.1.beta vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration.rb
challah-0.9.0 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration.rb
challah-0.6.2 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration.rb
challah-0.6.1 vendor/bundle/gems/mocha-0.10.3/lib/mocha/integration.rb
challah-0.6.1 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration.rb
challah-0.6.0 vendor/bundle/gems/mocha-0.10.3/lib/mocha/integration.rb
challah-0.6.0 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration.rb
challah-0.5.4 vendor/bundle/gems/mocha-0.10.3/lib/mocha/integration.rb
challah-0.5.4 vendor/bundle/gems/mocha-0.10.5/lib/mocha/integration.rb
challah-0.5.3 vendor/bundle/gems/mocha-0.10.3/lib/mocha/integration.rb