Do not force loading minitest when test-unit is available. Closes #88.

Credit goes to Matt Conway (@wr0ngway https://github.com/wr0ngway)
This commit is contained in:
J. Pablo Fernández 2012-06-15 11:39:17 +01:00
parent 0f41cd521c
commit c75c833491
1 changed files with 5 additions and 4 deletions

View File

@ -1,11 +1,12 @@
module Shoulda
module Matchers
if RUBY_VERSION > "1.9"
if defined?(Test::Unit::AssertionFailedError)
AssertionError = Test::Unit::AssertionFailedError
elsif Gem.ruby_version >= Gem::Version.new("1.9")
require 'minitest/unit'
AssertionError = MiniTest::Assertion
else
require 'test/unit/assertionfailederror'
AssertionError = Test::Unit::AssertionFailedError
raise "No unit test library available"
end
end
end
end