[macruby-changes] [3361] MacRuby/trunk/test_vm/module.rb

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 28 20:03:52 PST 2010


Revision: 3361
          http://trac.macosforge.org/projects/ruby/changeset/3361
Author:   lsansonetti at apple.com
Date:     2010-01-28 20:03:50 -0800 (Thu, 28 Jan 2010)
Log Message:
-----------
adding a failing test

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

Modified: MacRuby/trunk/test_vm/module.rb
===================================================================
--- MacRuby/trunk/test_vm/module.rb	2010-01-28 00:11:05 UTC (rev 3360)
+++ MacRuby/trunk/test_vm/module.rb	2010-01-29 04:03:50 UTC (rev 3361)
@@ -169,3 +169,29 @@
   class X; end
   X.foo
 }
+
+assert ':ok', %{
+  module M
+    def include(*mod)
+      @mods ||= []
+      @mods.push(*mod)
+    end
+    def new(*args,&b)
+      obj = allocate
+      if @mods
+        @mods.each { |m| obj.extend(m) }
+      end
+      obj.send(:initialize,*args,&b)
+      obj
+    end
+  end
+  module M2
+    def foo; p :ok; end
+  end
+  class X
+    extend M
+    include M2
+    def foo; raise; end
+  end
+  X.new.foo
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100128/f1699bdd/attachment.html>


More information about the macruby-changes mailing list