summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-11 17:22:39 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-11 17:22:39 +0000
commit0543b90d0f6a87e3a87f747c584c0d6737f221d4 (patch)
tree0573f559fed0f5af3b29e787a28baaecf15a3cd6 /test
parent490691c6e0f3ca7451775d2f1453df9ba3cf7391 (diff)
merge revision(s) 57362: [Backport #13096]
vm_method.c: resolve refined method to undef * vm_method.c (rb_undef): resolve the method entry which refines a prepended method entry. [ruby-core:78944] [Bug #13096] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 8af9945080..66202cda11 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1474,6 +1474,25 @@ class TestRefinement < Test::Unit::TestCase
INPUT
end
+ def test_undef_prepended_method
+ bug13096 = '[ruby-core:78944] [Bug #13096]'
+ klass = EnvUtil.labeled_class("X") do
+ def foo; end
+ end
+ klass.prepend(Module.new)
+ ext = EnvUtil.labeled_module("Ext") do
+ refine klass do
+ def foo
+ end
+ end
+ end
+ assert_nothing_raised(NameError, bug13096) do
+ klass.class_eval do
+ undef :foo
+ end
+ end
+ end
+
def test_call_refined_method_in_duplicate_module
bug10885 = '[ruby-dev:48878]'
assert_in_out_err([], <<-INPUT, [], [], bug10885)