Sha256: 654edd99355f71ef6a732741cbc590757ae33fc4ae85b031fc19765920b6a54f

Contents?: true

Size: 962 Bytes

Versions: 12

Compression:

Stored size: 962 Bytes

Contents

require 'test/unit/assertions'

module RSpec
  module Core
    # @private
    module TestUnitAssertionsAdapter
      include ::Test::Unit::Assertions

      # If using test/unit from Ruby core with Ruby 1.9+, it includes
      # MiniTest::Assertions by default. Note the upcasing of 'Test'.
      #
      # If the test/unit gem is being loaded, it will not include any minitest
      # assertions.
      #
      # Only if Minitest 5.x is included / loaded do we need to worry about
      # adding a shim for the new updates. Thus instead of checking on the
      # RUBY_VERSION we need to check ancestors.
      begin
        # MiniTest is 4.x
        # Minitest is 5.x
        if ancestors.include?(::Minitest::Assertions)
          require 'rspec/core/minitest_assertions_adapter'
          include ::RSpec::Core::MinitestAssertionsAdapter
        end
      rescue NameError => _ignored
        # No-op. Minitest 5.x was not loaded
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
rspec-core-2.99.2 lib/rspec/core/test_unit_assertions_adapter.rb
rspec-core-3.0.4 lib/rspec/core/test_unit_assertions_adapter.rb
rspec-core-3.0.3 lib/rspec/core/test_unit_assertions_adapter.rb
rspec-core-3.0.2 lib/rspec/core/test_unit_assertions_adapter.rb
rspec-core-2.99.1 lib/rspec/core/test_unit_assertions_adapter.rb
whos_dated_who-0.1.0 vendor/bundle/gems/rspec-core-3.0.1/lib/rspec/core/test_unit_assertions_adapter.rb
whos_dated_who-0.0.1 vendor/bundle/gems/rspec-core-3.0.1/lib/rspec/core/test_unit_assertions_adapter.rb
rspec-core-3.0.1 lib/rspec/core/test_unit_assertions_adapter.rb
rspec-core-3.0.0 lib/rspec/core/test_unit_assertions_adapter.rb
rspec-core-2.99.0 lib/rspec/core/test_unit_assertions_adapter.rb
rspec-core-3.0.0.rc1 lib/rspec/core/test_unit_assertions_adapter.rb
rspec-core-2.99.0.rc1 lib/rspec/core/test_unit_assertions_adapter.rb