summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-12 03:42:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-12 03:42:39 +0000
commita458e72e7c70fa7e3208cf31c115c42317116c06 (patch)
treeda2c6a86a897284ddae0b48e83931a6a8831c1e3 /test
parent704830be3d793a827e42d20e7f4687bfe94423bf (diff)
* 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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_exception.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index a26ade075b..52dd4665a1 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -296,13 +296,25 @@ end.join
exit
rescue SystemExit => e
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
abort
rescue SystemExit => e
end
- assert(!e.success?)
+ assert_not_send([e, :success?], "abort means failure")
end
def test_nomethoderror