diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_exception.rb | 16 |
2 files changed, 18 insertions, 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 the default message clearer. 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 |