mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_exception.rb (TestException#test_exit_success_p):
assert also the cases when exiting with true and false. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
704830be3d
commit
a458e72e7c
2 changed files with 18 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
||||||
Mon Sep 12 12:40:44 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Sep 12 12:42:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* test/ruby/test_exception.rb (TestException#test_exit_success_p):
|
||||||
|
assert also the cases when exiting with true and false.
|
||||||
|
|
||||||
* lib/test/unit/assertions.rb (assert_send): make arguments in
|
* lib/test/unit/assertions.rb (assert_send): make arguments in
|
||||||
the default message clearer.
|
the default message clearer.
|
||||||
|
|
|
@ -296,13 +296,25 @@ end.join
|
||||||
exit
|
exit
|
||||||
rescue SystemExit => e
|
rescue SystemExit => e
|
||||||
end
|
end
|
||||||
assert(e.success?)
|
assert_send([e, :success?], "success by default")
|
||||||
|
|
||||||
|
begin
|
||||||
|
exit(true)
|
||||||
|
rescue SystemExit => e
|
||||||
|
end
|
||||||
|
assert_send([e, :success?], "true means success")
|
||||||
|
|
||||||
|
begin
|
||||||
|
exit(false)
|
||||||
|
rescue SystemExit => e
|
||||||
|
end
|
||||||
|
assert_not_send([e, :success?], "false means failure")
|
||||||
|
|
||||||
begin
|
begin
|
||||||
abort
|
abort
|
||||||
rescue SystemExit => e
|
rescue SystemExit => e
|
||||||
end
|
end
|
||||||
assert(!e.success?)
|
assert_not_send([e, :success?], "abort means failure")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_nomethoderror
|
def test_nomethoderror
|
||||||
|
|
Loading…
Add table
Reference in a new issue