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 | b869c9abf0911d3e35b25805b206614baf02f6d6 (patch) | |
| tree | 409a44affa0f759fe6fc5a96815384d15dcbf3df /lib/test/unit/testcase.rb | |
| parent | 7260c8c414c9f39ef3521a1183a1172e9698cd81 (diff) | |
| download | ruby-b869c9abf0911d3e35b25805b206614baf02f6d6.tar.gz ruby-b869c9abf0911d3e35b25805b206614baf02f6d6.tar.xz ruby-b869c9abf0911d3e35b25805b206614baf02f6d6.zip | |
Rescue Exception in Test::Unit::TestCase#run. [ruby-core:08783]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test/unit/testcase.rb')
| -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 7524de999..017cd15b8 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) @@ -70,14 +76,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 |
