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

test_method.rb: split

* test/ruby/test_method.rb (test_define_method): split for each tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-03-31 08:18:04 +00:00
parent 31af17963d
commit 651c561b48

View file

@ -238,7 +238,9 @@ class TestMethod < Test::Unit::TestCase
assert_raise(TypeError) do
Class.new.class_eval { define_method(:bar, o.method(:bar)) }
end
end
def test_define_singleton_method
o = Object.new
def o.foo(c)
c.class_eval { define_method(:foo) }
@ -258,7 +260,9 @@ class TestMethod < Test::Unit::TestCase
assert_raise(TypeError) do
Module.new.module_eval {define_method(:foo, Base.instance_method(:foo))}
end
end
def test_define_method_transplating
feature4254 = '[ruby-core:34267]'
m = Module.new {define_method(:meth, M.instance_method(:meth))}
assert_equal(:meth, Object.new.extend(m).meth, feature4254)