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

ruby-changes:37051

From: nobu <ko1@a...>
Date: Sun, 4 Jan 2015 11:04:33 +0900 (JST)
Subject: [ruby-changes:37051] nobu:r49132 (trunk): unit.rb: no UNDEFINED

nobu	2015-01-04 11:04:26 +0900 (Sun, 04 Jan 2015)

  New Revision: 49132

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

  Log:
    unit.rb: no UNDEFINED
    
    * test/lib/minitest/unit.rb (UNDEFINED): remove.

  Modified files:
    trunk/test/lib/minitest/unit.rb
Index: test/lib/minitest/unit.rb
===================================================================
--- test/lib/minitest/unit.rb	(revision 49131)
+++ test/lib/minitest/unit.rb	(revision 49132)
@@ -73,12 +73,6 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/test/lib/minitest/unit.rb#L73
   # printed if the assertion fails.
 
   module Assertions
-    UNDEFINED = Object.new # :nodoc:
-
-    def UNDEFINED.inspect # :nodoc:
-      "UNDEFINED" # again with the rdoc bugs... :(
-    end
-
     ##
     # Returns the diff command to use in #diff. Tries to intelligently
     # figure out what diff to use.
@@ -311,8 +305,8 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/test/lib/minitest/unit.rb#L305
     #
     #   assert_operator 5, :<=, 4
 
-    def assert_operator o1, op, o2 = UNDEFINED, msg = nil
-      return assert_predicate o1, op, msg if UNDEFINED == o2
+    def assert_operator o1, op, o2 = (predicate = true; nil), msg = nil
+      return assert_predicate o1, op, msg if predicate
       msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op} #{mu_pp(o2)}" }
       assert o1.__send__(op, o2), msg
     end
@@ -676,8 +670,8 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/test/lib/minitest/unit.rb#L670
     #   refute_operator 1, :>, 2 #=> pass
     #   refute_operator 1, :<, 2 #=> fail
 
-    def refute_operator o1, op, o2 = UNDEFINED, msg = nil
-      return refute_predicate o1, op, msg if UNDEFINED == o2
+    def refute_operator o1, op, o2 = (predicate = true; nil), msg = nil
+      return refute_predicate o1, op, msg if predicate
       msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op} #{mu_pp(o2)}"}
       refute o1.__send__(op, o2), msg
     end

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

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