[test-unit-commit:00054] test-unit/test-unit [master] use __send__ instead of send.

null+test-unit @ clear-code.com null+test-unit @ clear-code.com
2011年 7月 20日 (水) 05:50:48 EDT


Kouhei Sutou	2011-07-20 09:50:48 +0000 (Wed, 20 Jul 2011)

  New Revision: f094d6bed59c058b7027f204e0c38439a6ef954f

  Log:
    use __send__ instead of send.

  Modified files:
    lib/test/unit/assertions.rb

  Modified: lib/test/unit/assertions.rb (+9 -9)
===================================================================
--- lib/test/unit/assertions.rb    2011-07-10 12:31:28 +0000 (bb2f371)
+++ lib/test/unit/assertions.rb    2011-07-20 09:50:48 +0000 (762444b)
@@ -1019,7 +1019,7 @@ EOT
                                        expected, actual,
                                        expected, actual)
           assert_block(full_message) do
-            expected.send(operator, actual)
+            expected.__send__(operator, actual)
           end
         end
       end
@@ -1129,7 +1129,7 @@ EOT
       def assert_predicate(object, predicate, message=nil)
         _wrap_assertion do
           assert_respond_to(object, predicate, message)
-          actual = object.send(predicate)
+          actual = object.__send__(predicate)
           full_message = build_message(message,
                                        "<?>.? is true value expected but was\n" +
                                        "<?>",
@@ -1151,7 +1151,7 @@ EOT
       def assert_not_predicate(object, predicate, message=nil)
         _wrap_assertion do
           assert_respond_to(object, predicate, message)
-          actual = object.send(predicate)
+          actual = object.__send__(predicate)
           full_message = build_message(message,
                                        "<?>.? is false value expected but was\n" +
                                        "<?>",
@@ -1769,7 +1769,7 @@ EOM
           end
 
           def method_missing(name, *args, &block)
-            @exception.send(name, *args, &block)
+            @exception.__send__(name, *args, &block)
           end
 
           private
@@ -1825,10 +1825,10 @@ EOM
             elsif exception_type.is_a?(Exception)
               exception_objects << exception_type
             else
-              @test_case.send(:assert,
-                              Exception >= exception_type,
-                              "Should expect a class of exception, " +
-                              "#{exception_type}")
+              @test_case.__send__(:assert,
+                                  Exception >= exception_type,
+                                  "Should expect a class of exception, " +
+                                  "#{exception_type}")
               exception_classes << exception_type
             end
           end
@@ -1837,7 +1837,7 @@ EOM
 
         def expected_class?(actual_exception, equality)
           @expected_classes.any? do |expected_class|
-            actual_exception.send(equality, expected_class)
+            actual_exception.__send__(equality, expected_class)
           end
         end
 



test-unit-commit メーリングリストの案内