diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-12 15:08:52 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-12 15:08:52 +0000 |
commit | 43a23548ca76a8a1863f9186f34c67073d8f474c (patch) | |
tree | 0a4e080d669ca8b284a50f8e7af0c5c7cf5f0be0 /test/ruby | |
parent | d9a82430ba369a4cf3fc55db3a0b8ff3b90b0c09 (diff) | |
download | ruby-43a23548ca76a8a1863f9186f34c67073d8f474c.tar.gz |
* vm_insnhelper.c (vm_call_method_missing): method_missing should
not be refined.
[ruby-core:72080] [Bug #11809]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-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 80407c01a2..52b7ac7086 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -1594,6 +1594,31 @@ class TestRefinement < Test::Unit::TestCase assert_equal([:R2_baz, [:R1_foo, :orig_foo]], MixedUsing2.f2) end + module MethodMissing + class Foo + end + + module Bar + refine Foo do + def method_missing(mid, *args) + "method_missing refined" + end + end + end + + using Bar + + def self.call_undefined_method + Foo.new.foo + end + end + + def test_method_missing + assert_raise(NoMethodError) do + MethodMissing.call_undefined_method + end + end + private def eval_using(mod, s) |