提交 728606df 编写于 作者: J Jeremy Kemper

Just rescue exception rather than checking for both miniunit and test/unit

上级 f12a2b48
......@@ -5,6 +5,7 @@
$:.unshift "#{File.dirname(__FILE__)}/../lib"
$:.unshift File.dirname(__FILE__)
require 'active_support'
require 'active_support/test_case'
if RUBY_VERSION < '1.9'
$KCODE = 'UTF8'
......
require 'abstract_unit'
require 'active_support/test_case'
class AssertDifferenceTest < ActiveSupport::TestCase
def setup
......@@ -66,10 +65,8 @@ def test_array_of_expressions_identify_failure
@object.increment
end
fail 'should not get to here'
rescue MiniTest::Assertion => e
rescue Exception => e
assert_equal "<3> expected but was\n<2>.", e.message
rescue Test::Unit::AssertionFailedError => e
assert_equal "<1 + 1> was the expression that failed.\n<3> expected but was\n<2>.", e.message
end
def test_array_of_expressions_identify_failure_when_message_provided
......@@ -77,10 +74,8 @@ def test_array_of_expressions_identify_failure_when_message_provided
@object.increment
end
fail 'should not get to here'
rescue MiniTest::Assertion => e
rescue Exception => e
assert_equal "something went wrong.\n<3> expected but was\n<2>.", e.message
rescue Test::Unit::AssertionFailedError => e
assert_equal "something went wrong.\n<1 + 1> was the expression that failed.\n<3> expected but was\n<2>.", e.message
end
else
def default_test; end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册