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