mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Rescue Exception in Test::Unit::TestCase#run. [ruby-core:08783]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d70fc5798e
commit
7d3fc8ff2b
2 changed files with 15 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Sep 9 14:08:38 2006 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* lib/test/unit/testcase.rb (Test::Unit::TestCase#run): Rescue
|
||||
Exception in Test::Unit::TestCase#run. [ruby-core:08783]
|
||||
|
||||
Sat Sep 9 04:55:59 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/pstore.rb: open all in binary mode, and get rid of the quirk of
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue