Sha256: cbcef2c249b1a4d7b82729fcaa8e22b1b1e898f28ef2d23ed274e119551dd389

Contents?: true

Size: 836 Bytes

Versions: 6

Compression:

Stored size: 836 Bytes

Contents

module Shoulda
  module Matchers
    if defined?(ActiveSupport::TestCase)
      # @private
      AssertionError = ActiveSupport::TestCase::Assertion
    elsif Gem.ruby_version >= Gem::Version.new('1.8') && Gem.ruby_version < Gem::Version.new('1.9')
      require 'test/unit'
      # @private
      AssertionError = Test::Unit::AssertionFailedError
    elsif defined?(Test::Unit::AssertionFailedError)
      # Test::Unit has been loaded already, so we use it
      # @private
      AssertionError = Test::Unit::AssertionFailedError
    elsif Gem.ruby_version >= Gem::Version.new("1.9")
      begin
        require 'minitest'
      rescue LoadError
        require 'minitest/unit'
      ensure
      # @private
        AssertionError = MiniTest::Assertion
      end
    else
      raise 'No unit test library available'
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/shoulda-matchers-2.8.0/lib/shoulda/matchers/assertion_error.rb
shoulda-matchers-2.8.0 lib/shoulda/matchers/assertion_error.rb
shoulda-matchers-2.8.0.rc2 lib/shoulda/matchers/assertion_error.rb
shoulda-matchers-2.8.0.rc1 lib/shoulda/matchers/assertion_error.rb
shoulda-matchers-2.7.0 lib/shoulda/matchers/assertion_error.rb
shoulda-matchers-2.6.2 lib/shoulda/matchers/assertion_error.rb