B
brian.kejser
Hi
In the file testcase.rb that is part of the Test module why are only the
AssertionFailedError, StandardError and ScriptError exceptions caught?
Shouldn't snippet one (see below) be changed to snippet two (see below)?
Thanks
Snippet One:
begin
setup
__send__(@method_name)
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue StandardError, ScriptError
add_error($!)
ensure
begin
teardown
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue StandardError, ScriptError
add_error($!)
end
end
Snippet Two:
begin
setup
__send__(@method_name)
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue Object
add_error($!)
ensure
begin
teardown
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue Object
add_error($!)
end
end
Here's the run method that is part of the testcase class ....
def run(result)
yield(STARTED, name)
@_result = result
begin
setup
__send__(@method_name)
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue Object #StandardError, ScriptError
add_error($!)
ensure
begin
teardown
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue Object #StandardError, ScriptError
add_error($!)
end
end
result.add_run
yield(FINISHED, name)
end
In the file testcase.rb that is part of the Test module why are only the
AssertionFailedError, StandardError and ScriptError exceptions caught?
Shouldn't snippet one (see below) be changed to snippet two (see below)?
Thanks
Snippet One:
begin
setup
__send__(@method_name)
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue StandardError, ScriptError
add_error($!)
ensure
begin
teardown
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue StandardError, ScriptError
add_error($!)
end
end
Snippet Two:
begin
setup
__send__(@method_name)
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue Object
add_error($!)
ensure
begin
teardown
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue Object
add_error($!)
end
end
Here's the run method that is part of the testcase class ....
def run(result)
yield(STARTED, name)
@_result = result
begin
setup
__send__(@method_name)
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue Object #StandardError, ScriptError
add_error($!)
ensure
begin
teardown
rescue AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue Object #StandardError, ScriptError
add_error($!)
end
end
result.add_run
yield(FINISHED, name)
end