Skip to content
Browse files

Fix the build on Ruby 1.8 using Test::Unit

  • Loading branch information...
1 parent e604562 commit 27b8b781a5d708fbbea10b6a431df6b09ba95e47 @mike-burns mike-burns committed Jul 10, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/shoulda/matchers/assertion_error.rb
View
5 lib/shoulda/matchers/assertion_error.rb
@@ -1,6 +1,7 @@
module Shoulda
module Matchers
- if defined?(Test::Unit::AssertionFailedError)
+ if Gem.ruby_version >= Gem::Version.new('1.8') && Gem.ruby_version < Gem::Version.new('1.9')
+ require 'test/unit'
AssertionError = Test::Unit::AssertionFailedError
elsif Gem.ruby_version >= Gem::Version.new("1.9")
require 'minitest/unit'
@@ -9,4 +10,4 @@ module Matchers
raise "No unit test library available"
end
end
-end
+end

0 comments on commit 27b8b78

Please sign in to comment.
Something went wrong with that request. Please try again.