[前][次][番号順一覧][スレッド一覧]

ruby-changes:32304

From: nobu <ko1@a...>
Date: Tue, 24 Dec 2013 19:05:24 +0900 (JST)
Subject: [ruby-changes:32304] nobu:r44383 (trunk): assertions.rb: fix return value

nobu	2013-12-24 19:05:18 +0900 (Tue, 24 Dec 2013)

  New Revision: 44383

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44383

  Log:
    assertions.rb: fix return value
    
    * lib/test/unit/assertions.rb (assert_throw): should return the
      caught value.

  Modified files:
    trunk/lib/test/unit/assertions.rb
Index: lib/test/unit/assertions.rb
===================================================================
--- lib/test/unit/assertions.rb	(revision 44382)
+++ lib/test/unit/assertions.rb	(revision 44383)
@@ -192,7 +192,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/lib/test/unit/assertions.rb#L192
       #      throw tag
       #    end
       def assert_throw(tag, msg = nil)
-        catch(tag) do
+        ret = catch(tag) do
           begin
             yield(tag)
           rescue ArgumentError => e
@@ -205,6 +205,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/lib/test/unit/assertions.rb#L205
           assert(false, msg)
         end
         assert(true)
+        ret
       end
 
       # :call-seq:

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]