diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-29 06:25:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-29 06:25:21 +0000 |
commit | 149dadf368981bdd026dd0e86278cc86d74d48a6 (patch) | |
tree | 8806e0ddd9c4bd6512c2dfa60a1737fc2952fbb7 /test/ruby | |
parent | 48f9012df931de3a526db7d3ce03c408a2c11ba5 (diff) | |
download | ruby-149dadf368981bdd026dd0e86278cc86d74d48a6.tar.gz |
vm_eval.c: set method_missing_reason
* vm_eval.c (send_internal): set method_missing_reason before
invoking overriding method_missing method so that the default
method_missing can achieve it properly.
[ruby-core:68515] [Bug #10969]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_exception.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 2817c63bed..b4567d9187 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -704,4 +704,11 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| raise E end; end + + def test_method_missing_reason_clear + bug10969 = '[ruby-core:68515] [Bug #10969]' + a = Class.new {def method_missing(*) super end}.new + assert_raise(NameError) {a.instance_eval("foo")} + assert_raise(NoMethodError, bug10969) {a.public_send("bar", true)} + end end |