diff options
| author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-09 05:14:40 +0000 |
|---|---|---|
| committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-09 05:14:40 +0000 |
| commit | 25f41cb52253acc0edc5340838c6c445cc2527d2 (patch) | |
| tree | 288931b33c3b7dcec6e572a62079d83158f5bcc7 /lib/test | |
| parent | 8de1f0016557079e19c50ba4431ef3ac9cc9005c (diff) | |
| download | ruby-25f41cb52253acc0edc5340838c6c445cc2527d2.tar.gz ruby-25f41cb52253acc0edc5340838c6c445cc2527d2.tar.xz ruby-25f41cb52253acc0edc5340838c6c445cc2527d2.zip | |
Rescue Exception in Test::Unit::TestCase#run. [ruby-core:08783]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test')
| -rw-r--r-- | lib/test/unit/testcase.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/test/unit/testcase.rb b/lib/test/unit/testcase.rb index b6bb420f9..0b8d235cd 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 |
