From 18099b0fd53b8f9ba88ef46bdd910347f03c72c5 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 7 Nov 2008 12:45:48 -0500 Subject: Rework testing extensions to reflect the recent miniunit upheaval --- activesupport/test/test_test.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'activesupport/test/test_test.rb') diff --git a/activesupport/test/test_test.rb b/activesupport/test/test_test.rb index d4ae221f4f..f3d29e6de4 100644 --- a/activesupport/test/test_test.rb +++ b/activesupport/test/test_test.rb @@ -66,6 +66,8 @@ class AssertDifferenceTest < ActiveSupport::TestCase @object.increment end fail 'should not get to here' + rescue MiniTest::Assertion => 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 @@ -75,6 +77,8 @@ class AssertDifferenceTest < ActiveSupport::TestCase @object.increment end fail 'should not get to here' + rescue MiniTest::Assertion => 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 @@ -84,8 +88,10 @@ class AssertDifferenceTest < ActiveSupport::TestCase end # These should always pass -class NotTestingThingsTest < Test::Unit::TestCase - include ActiveSupport::Testing::Default +if defined? ActiveSupport::Testing::Default + class NotTestingThingsTest < Test::Unit::TestCase + include ActiveSupport::Testing::Default + end end class AlsoDoingNothingTest < ActiveSupport::TestCase -- cgit v1.2.3