diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-10 02:40:21 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-10 02:40:21 +0000 |
commit | 53053bcac63f361c190280409ac99dab9bea41b3 (patch) | |
tree | ae2a945fc765375b160b206045461eb4177995a6 /test | |
parent | 25dda42b7c20178b15968efeb47984c0316075bc (diff) | |
download | ruby-53053bcac63f361c190280409ac99dab9bea41b3.tar.gz |
* vm_insnhelper.c (vm_call_method): stop method search when a method
is not found in a refinement, to support undef in refinements.
[ruby-core:66741] [Bug #10578]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_refinement.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 3d703e5a3b..d97893cf71 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -1387,6 +1387,19 @@ class TestRefinement < Test::Unit::TestCase :foo, bug10826) end + def test_undef_original_method + assert_in_out_err([], <<-INPUT, ["NoMethodError"], []) + module NoPlus + refine String do + undef + + end + end + + using NoPlus + "a" + "b" rescue p($!.class) + INPUT + end + private def eval_using(mod, s) |