aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_method.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-09 07:15:48 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-09 07:15:48 +0000
commit303cd88d408b7f8b79b0580cf3d552d6e291f5df (patch)
tree7713b5360f47699dc1079ef3475386499f28b8a9 /test/ruby/test_method.rb
parent0599d7de5844a2f838cdf631b9c88b05010ebe5d (diff)
downloadruby-303cd88d408b7f8b79b0580cf3d552d6e291f5df.tar.gz
* vm.c (rb_vm_cref_in_context): Module#define_method in non-class
expression should be public. [Bug #11754] * test/ruby/test_method.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_method.rb')
-rw-r--r--test/ruby/test_method.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 9e20d5cc22..48178c4d7a 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -924,6 +924,8 @@ class TestMethod < Test::Unit::TestCase
def m1
def m2
end
+
+ self.class.send(:define_method, :m3){} # [Bug #11754]
end
private
end
@@ -933,7 +935,7 @@ class TestMethod < Test::Unit::TestCase
assert_equal([].sort, MethodInMethodClass.private_instance_methods(false).sort)
MethodInMethodClass.new.m1
- assert_equal([:m1, :m2].sort, MethodInMethodClass.public_instance_methods(false).sort)
+ assert_equal([:m1, :m2, :m3].sort, MethodInMethodClass.public_instance_methods(false).sort)
assert_equal([].sort, MethodInMethodClass.private_instance_methods(false).sort)
end
end