ruby-changes:27969
From: nobu <ko1@a...>
Date: Sun, 31 Mar 2013 17:18:14 +0900 (JST)
Subject: [ruby-changes:27969] nobu:r40021 (trunk): test_method.rb: split
nobu 2013-03-31 17:18:04 +0900 (Sun, 31 Mar 2013) New Revision: 40021 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40021 Log: test_method.rb: split * test/ruby/test_method.rb (test_define_method): split for each tests. Modified files: trunk/test/ruby/test_method.rb Index: test/ruby/test_method.rb =================================================================== --- test/ruby/test_method.rb (revision 40020) +++ test/ruby/test_method.rb (revision 40021) @@ -238,7 +238,9 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_method.rb#L238 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_method.rb#L260 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/