Sha256: 1de2562d613203efad25bfba5c84de0b28855a986abab75f444c646fe13b5aa0

Contents?: true

Size: 1.86 KB

Versions: 15

Compression:

Stored size: 1.86 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'

require 'mocha/deprecation'

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
          unless integration_module == MiniTest::Adapter
            Deprecation.warning(
              'Versions of minitest earlier than v3.3.0 will not be supported in future versions of Mocha.'
            )
          end
          Debug.puts "Applying #{integration_module.description}"
          target.send(:include, integration_module)
        end
        true
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mocha-1.16.1 lib/mocha/integration/mini_test.rb
mocha-1.15.1 lib/mocha/integration/mini_test.rb
mocha-1.16.0 lib/mocha/integration/mini_test.rb
mocha-1.15.0 lib/mocha/integration/mini_test.rb
mocha-1.14.0 lib/mocha/integration/mini_test.rb
mocha-1.13.0 lib/mocha/integration/mini_test.rb
mocha-1.12.0 lib/mocha/integration/mini_test.rb
mocha-1.11.2 lib/mocha/integration/mini_test.rb
mocha-1.11.1 lib/mocha/integration/mini_test.rb
mocha-1.11.0 lib/mocha/integration/mini_test.rb
mocha-1.10.2 lib/mocha/integration/mini_test.rb
mocha-1.10.1 lib/mocha/integration/mini_test.rb
mocha-1.10.0 lib/mocha/integration/mini_test.rb
mocha-1.10.0.beta.1 lib/mocha/integration/mini_test.rb
mocha-1.10.0.alpha lib/mocha/integration/mini_test.rb