[macruby-changes] [2882] MacRuby/trunk/test_vm/dispatch.rb

source_changes at macosforge.org source_changes at macosforge.org
Thu Oct 22 04:27:50 PDT 2009


Revision: 2882
          http://trac.macosforge.org/projects/ruby/changeset/2882
Author:   eloy.de.enige at gmail.com
Date:     2009-10-22 04:27:47 -0700 (Thu, 22 Oct 2009)
Log Message:
-----------
Added failing test_vm test about allowing a protected method to be called with `send'.

Modified Paths:
--------------
    MacRuby/trunk/test_vm/dispatch.rb

Modified: MacRuby/trunk/test_vm/dispatch.rb
===================================================================
--- MacRuby/trunk/test_vm/dispatch.rb	2009-10-22 00:36:39 UTC (rev 2881)
+++ MacRuby/trunk/test_vm/dispatch.rb	2009-10-22 11:27:47 UTC (rev 2882)
@@ -89,6 +89,18 @@
   end
 }
 
+assert ':ok', %{
+  class X
+    def method_missing(x, *args, &block)
+      p :ok if x == :foo and block.call == 42
+    end
+    
+    protected
+    def foo; end
+  end
+  X.new.send(:foo) { 42 }
+}
+
 assert "42", "def foo; return 42; end; p foo"
 assert "42", "def foo(x); if x; return 42; end; end; p foo(true)"
 assert "42", "def foo(x); if x; x += 2; return x; end; end; p foo(40)"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091022/a45c46d5/attachment.html>


More information about the macruby-changes mailing list