summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-03 08:55:40 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-03 08:55:40 +0000
commit1bd36e36e09f5bccb5110d197e8494d0d7e19000 (patch)
tree5242825f796c48cc8b8fab5cd985b56aeea21616 /test
parentdffe87c72014a4732282126acc87c898fddb0d81 (diff)
merge revision(s) 50430,50440: [Backport #11117]
* vm_eval.c (rb_method_call_status): undefined refined method is not callable unless using. [ruby-core:69064] [Bug #11117] * vm_eval.c (rb_method_call_status): resolve refined method entry to check if undefined. [ruby-core:69064] [Bug #11117] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@51119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 4ed0423abd..b116dbbf62 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1399,6 +1399,33 @@ class TestRefinement < Test::Unit::TestCase
INPUT
end
+ def test_check_funcall_undefined
+ bug11117 = '[ruby-core:69064] [Bug #11117]'
+
+ x = Class.new
+ Module.new do
+ refine x do
+ def to_regexp
+ //
+ end
+ end
+ end
+
+ assert_nothing_raised(NoMethodError, bug11117) {
+ assert_nil(Regexp.try_convert(x.new))
+ }
+ end
+
+ def test_funcall_inherited
+ bug11117 = '[ruby-core:69064] [Bug #11117]'
+
+ Module.new {refine(Dir) {def to_s; end}}
+ x = Class.new(Dir).allocate
+ assert_nothing_raised(NoMethodError, bug11117) {
+ x.inspect
+ }
+ end
+
private
def eval_using(mod, s)