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

ruby-changes:18483

From: nobu <ko1@a...>
Date: Mon, 10 Jan 2011 14:37:41 +0900 (JST)
Subject: [ruby-changes:18483] Ruby:r30506 (trunk): * test/ruby/test_method.rb (TestMethod#test_define_method): method

nobu	2011-01-10 14:32:59 +0900 (Mon, 10 Jan 2011)

  New Revision: 30506

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

  Log:
    * test/ruby/test_method.rb (TestMethod#test_define_method): method
      transplanting between class and module is impossible.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_method.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30505)
+++ ChangeLog	(revision 30506)
@@ -1,3 +1,8 @@
+Mon Jan 10 14:32:55 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* test/ruby/test_method.rb (TestMethod#test_define_method): method
+	  transplanting between class and module is impossible.
+
 Mon Jan 10 13:51:17 2011  Nobuyoshi Nakada  <nobu@r...>
 
 	* misc/rdoc-mode.el (rdoc-mode): show trailing whitespace.
Index: test/ruby/test_method.rb
===================================================================
--- test/ruby/test_method.rb	(revision 30505)
+++ test/ruby/test_method.rb	(revision 30506)
@@ -197,6 +197,14 @@
     assert_raise(TypeError) do
       Class.new.class_eval { define_method(:foo, Object.new) }
     end
+
+    assert_raise(TypeError) do
+      Module.new.module_eval {define_method(:foo, Base.instance_method(:foo))}
+    end
+
+    assert_raise(TypeError) do
+      Class.new.class_eval {define_method(:meth, M.instance_method(:meth))}
+    end
   end
 
   def test_clone

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

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