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:
parent
31af17963d
commit
651c561b48
1 changed files with 4 additions and 0 deletions
|
@ -238,7 +238,9 @@ class TestMethod < Test::Unit::TestCase
|
||||||
assert_raise(TypeError) do
|
assert_raise(TypeError) do
|
||||||
Class.new.class_eval { define_method(:bar, o.method(:bar)) }
|
Class.new.class_eval { define_method(:bar, o.method(:bar)) }
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_define_singleton_method
|
||||||
o = Object.new
|
o = Object.new
|
||||||
def o.foo(c)
|
def o.foo(c)
|
||||||
c.class_eval { define_method(:foo) }
|
c.class_eval { define_method(:foo) }
|
||||||
|
@ -258,7 +260,9 @@ class TestMethod < Test::Unit::TestCase
|
||||||
assert_raise(TypeError) do
|
assert_raise(TypeError) do
|
||||||
Module.new.module_eval {define_method(:foo, Base.instance_method(:foo))}
|
Module.new.module_eval {define_method(:foo, Base.instance_method(:foo))}
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_define_method_transplating
|
||||||
feature4254 = '[ruby-core:34267]'
|
feature4254 = '[ruby-core:34267]'
|
||||||
m = Module.new {define_method(:meth, M.instance_method(:meth))}
|
m = Module.new {define_method(:meth, M.instance_method(:meth))}
|
||||||
assert_equal(:meth, Object.new.extend(m).meth, feature4254)
|
assert_equal(:meth, Object.new.extend(m).meth, feature4254)
|
||||||
|
|
Loading…
Reference in a new issue