summaryrefslogtreecommitdiffstats
path: root/lib/test/unit/assertions.rb
diff options
context:
space:
mode:
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 b0df0ea2d..2833eba10 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