aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test/unit/assertions.rb
diff options
context:
space:
mode:
authorntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-02 02:20:42 +0000
committerntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-02 02:20:42 +0000
commit18ef8f10782e202f1605ff2d3d59241f62989b67 (patch)
treec7f409e15a07e445cdb5ee22335735eb1e75c229 /lib/test/unit/assertions.rb
parent8caf81f1eafc07c14ec8ed006e07c362965ed32f (diff)
downloadruby-18ef8f10782e202f1605ff2d3d59241f62989b67.tar.gz
* lib/test/unit/assertions.rb: should not capture an
AssertionFailedError unless explicitly requested. * test/testunit/test_assertions.rb: ditto. * test/testunit/collector/test_objectspace.rb: fixed a test failure caused by methods being returned in different orders on different platforms by moving test sorting from TestSuite into the locations where suites are constructed. [ruby-talk:83156] * lib/test/unit/testcase.rb: ditto. * lib/test/unit/testsuite.rb: ditto. * lib/test/unit/collector/objectspace.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test/unit/assertions.rb')
-rw-r--r--lib/test/unit/assertions.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb
index b0df0ea2db..2833eba10d 100644
--- a/lib/test/unit/assertions.rb
+++ b/lib/test/unit/assertions.rb
@@ -182,15 +182,15 @@ module Test # :nodoc:
end
begin
yield
- rescue Exception => thrown_exception
- if (args.empty? || args.include?(thrown_exception.class))
- full_message = build_message(message, thrown_exception) do |arg1|
+ rescue Exception => e
+ if ((args.empty? && !e.instance_of?(AssertionFailedError)) || args.include?(e.class))
+ full_message = build_message(message, e) do |arg1|
"Exception raised:\n" +
arg1
end
flunk(full_message)
else
- raise thrown_exception.class, thrown_exception.message, thrown_exception.backtrace
+ raise e.class, e.message, e.backtrace
end
end
nil