diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-28 18:13:42 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-28 18:13:42 +0000 |
commit | f50f70259ded4e1be9c197dd04d7da9518e8ca68 (patch) | |
tree | ec329df0ce15ba81a38b2a749df20f72ce1ad145 /test/ruby/test_refinement.rb | |
parent | c839def7cc34f858777b15d2d84cb45b585d9699 (diff) |
merge revision(s) r49221: [Backport #10731]
* vm_method.c (rb_alias): raise a NameError when creating alias to
a refined method if the original method of the refined method is
not defined. [ruby-core:67523] [Bug #10731]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@49787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_refinement.rb')
-rw-r--r-- | test/ruby/test_refinement.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 65137f0e3a..98bf9c6027 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -1181,6 +1181,31 @@ class TestRefinement < Test::Unit::TestCase end; end + def test_alias_refined_method + assert_separately([], <<-"end;") + bug10731 = '[ruby-core:67523] [Bug #10731]' + + class C + end + + module RefinementBug + refine C do + def foo + end + + def bar + end + end + end + + assert_raise(NameError, bug10731) do + class C + alias foo bar + end + end + end; + end + private def eval_using(mod, s) |