summaryrefslogtreecommitdiff
path: root/lib/test/unit/testcase.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/test/unit/testcase.rb')
-rw-r--r--lib/test/unit/testcase.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/test/unit/testcase.rb b/lib/test/unit/testcase.rb
index b6bb420f96..0b8d235cd6 100644
--- a/lib/test/unit/testcase.rb
+++ b/lib/test/unit/testcase.rb
@@ -28,6 +28,12 @@ module Test
STARTED = name + "::STARTED"
FINISHED = name + "::FINISHED"
+ ##
+ # These exceptions are not caught by #run.
+
+ PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException, Interrupt,
+ SystemExit]
+
# Creates a new instance of the fixture for running the
# test represented by test_method_name.
def initialize(test_method_name)
@@ -72,14 +78,16 @@ module Test
__send__(@method_name)
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
- rescue StandardError, ScriptError
+ rescue Exception
+ raise if PASSTHROUGH_EXCEPTIONS.include? $!.class
add_error($!)
ensure
begin
teardown
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
- rescue StandardError, ScriptError
+ rescue Exception
+ raise if PASSTHROUGH_EXCEPTIONS.include? $!.class
add_error($!)
end
end