ruby-changes:21204
From: nobu <ko1@a...>
Date: Mon, 12 Sep 2011 12:44:45 +0900 (JST)
Subject: [ruby-changes:21204] nobu:r33253 (trunk): * test/ruby/test_exception.rb (TestException#test_exit_success_p):
nobu 2011-09-12 12:42:39 +0900 (Mon, 12 Sep 2011) New Revision: 33253 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33253 Log: * test/ruby/test_exception.rb (TestException#test_exit_success_p): assert also the cases when exiting with true and false. Modified files: trunk/ChangeLog trunk/test/ruby/test_exception.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 33252) +++ ChangeLog (revision 33253) @@ -1,5 +1,8 @@ -Mon Sep 12 12:40:44 2011 Nobuyoshi Nakada <nobu@r...> +Mon Sep 12 12:42:36 2011 Nobuyoshi Nakada <nobu@r...> + * 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. Index: test/ruby/test_exception.rb =================================================================== --- test/ruby/test_exception.rb (revision 33252) +++ test/ruby/test_exception.rb (revision 33253) @@ -296,13 +296,25 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/