1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_method.rb (TestMethod#test_define_method): method

transplanting between class and module is impossible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-01-10 05:32:59 +00:00
parent 594793f588
commit fd7c5303eb
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Mon Jan 10 14:32:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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@ruby-lang.org>
* misc/rdoc-mode.el (rdoc-mode): show trailing whitespace.

View file

@ -197,6 +197,14 @@ class TestMethod < Test::Unit::TestCase
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