From d7e152bf0607af317da8cbf6b33d8e0685686151 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 27 Jan 2015 07:43:57 +0000 Subject: merge revision(s) 49182,49183: [Backport #10706] vm_method.c: fix change refined new method visibility * vm_method.c (rb_export_method): bail out if the original method is undefined when the method is refined. [ruby-core:67387] [Bug #10706] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@49423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_refinement.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 417059f651..a98d3332bf 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -1002,6 +1002,20 @@ class TestRefinement < Test::Unit::TestCase INPUT end + def test_change_refined_new_method_visibility + assert_separately(['-W0'], <<-"end;") + bug10706 = '[ruby-core:67387] [Bug #10706]' + module RefinementBug + refine Object do + def foo + end + end + end + + assert_raise(NameError, bug10706) {private(:foo)} + end; + end + private def eval_using(mod, s) -- cgit v1.2.3