lib/assert_value.rb in assert_value-1.1 vs lib/assert_value.rb in assert_value-1.2
- old
+ new
@@ -1,13 +1,19 @@
# Copyright (c) 2010-2011 Pluron, Inc.
-require 'test/unit/testcase'
+
+if defined?(Minitest)
+ # nothing to require, minitest gem is already loaded
+ # it's the only way we can detect Minitest presence
+else
+ require 'test/unit/testcase'
+end
require 'text_diff'
require 'pathname'
$assert_value_options = []
-if RUBY_VERSION >= "1.9.0"
+if RUBY_VERSION >= "1.9.0" and !defined?(Minitest) # minitest options are handled by minitest/assert_value_plugin.rb
# Test/Unit from Ruby 1.9 can't accept additional options like it did in 1.8:
# ruby test.rb -- --foo
# Now it has a strict option parser that considers all additional options as files.
# The right way to have an option now is to explicitly add it to Test/Unit parser.
@@ -404,11 +410,17 @@
end
end
if RUBY_VERSION >= "1.9.0"
- class MiniTest::Unit::TestCase
- include AssertValueAssertion
+ if defined? Minitest::Test
+ class Minitest::Test
+ include AssertValueAssertion
+ end
+ else
+ class MiniTest::Unit::TestCase
+ include AssertValueAssertion
+ end
end
else
class Test::Unit::TestCase
include AssertValueAssertion
end