Sha256: b1d3447e491ef4a1d98ef8d394ae8ebce9b286b9f25690db00e0ab7438774277

Contents?: true

Size: 1.61 KB

Versions: 18

Compression:

Stored size: 1.61 KB

Contents

require 'mocha/debug'

require 'mocha/detection/mini_test'

require 'mocha/integration/mini_test/nothing'
require 'mocha/integration/mini_test/version_13'
require 'mocha/integration/mini_test/version_140'
require 'mocha/integration/mini_test/version_141'
require 'mocha/integration/mini_test/version_142_to_172'
require 'mocha/integration/mini_test/version_200'
require 'mocha/integration/mini_test/version_201_to_222'
require 'mocha/integration/mini_test/version_230_to_2101'
require 'mocha/integration/mini_test/version_2110_to_2111'
require 'mocha/integration/mini_test/version_2112_to_320'
require 'mocha/integration/mini_test/adapter'

module Mocha
  module Integration
    module MiniTest
      def self.activate
        return false unless Detection::MiniTest.testcase
        mini_test_version = Gem::Version.new(Detection::MiniTest.version)

        Debug.puts "Detected MiniTest version: #{mini_test_version}"

        integration_module = [
          MiniTest::Adapter,
          MiniTest::Version2112To320,
          MiniTest::Version2110To2111,
          MiniTest::Version230To2101,
          MiniTest::Version201To222,
          MiniTest::Version200,
          MiniTest::Version142To172,
          MiniTest::Version141,
          MiniTest::Version140,
          MiniTest::Version13,
          MiniTest::Nothing
        ].detect { |m| m.applicable_to?(mini_test_version) }

        target = Detection::MiniTest.testcase
        unless target < integration_module
          Debug.puts "Applying #{integration_module.description}"
          target.send(:include, integration_module)
        end
        true
      end
    end
  end
end

Version data entries

18 entries across 15 versions & 3 rubygems

Version Path
mocha-1.9.0 lib/mocha/integration/mini_test.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/mocha-1.8.0/lib/mocha/integration/mini_test.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/mocha-1.8.0/lib/mocha/integration/mini_test.rb
mocha-1.8.0 lib/mocha/integration/mini_test.rb
mocha-1.7.0 lib/mocha/integration/mini_test.rb
mocha-1.6.0 lib/mocha/integration/mini_test.rb
mocha-1.5.0 lib/mocha/integration/mini_test.rb
mocha-1.4.0 lib/mocha/integration/mini_test.rb
mocha-1.3.0 lib/mocha/integration/mini_test.rb
mocha-1.2.1 lib/mocha/integration/mini_test.rb
mocha-1.2.0 lib/mocha/integration/mini_test.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/mocha-1.0.0/lib/mocha/integration/mini_test.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/mocha-1.0.0/lib/mocha/integration/mini_test.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/mocha-1.0.0/lib/mocha/integration/mini_test.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/mocha-1.0.0/lib/mocha/integration/mini_test.rb
mocha-1.1.0 lib/mocha/integration/mini_test.rb
mocha-1.0.0 lib/mocha/integration/mini_test.rb
mocha-1.0.0.alpha lib/mocha/integration/mini_test.rb