aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_array.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-20 05:13:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-20 05:13:28 +0000
commitb7d5fa3cbfc0725aece8653985380f6034a454b0 (patch)
treeb2fe87f9c90528d9506a8dda119954ffa13803bd /test/ruby/test_array.rb
parent64e3516b2497c734baf81527885a76239c898ee5 (diff)
downloadruby-b7d5fa3cbfc0725aece8653985380f6034a454b0.tar.gz
vm_eval.c: share with rb_obj_respond_to
* vm_eval.c (check_funcall_respond_to): share the behavior with rb_obj_respond_to. [ruby-core:70460] [Bug #11465] * vm_method.c (vm_respond_to): extract from rb_obj_respond_to and merge r39881. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r--test/ruby/test_array.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 977c14cfa0..ea551dbeba 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -855,6 +855,28 @@ class TestArray < Test::Unit::TestCase
assert_match(/reentered/, e.message, '[ruby-dev:34798]')
end
+ def test_flatten_respond_to_missing
+ bug11465 = '[ruby-core:70460] [Bug #11465]'
+
+ obj = Class.new do
+ def respond_to_missing?(method, stuff)
+ return false if method == :to_ary
+ super
+ end
+
+ def method_missing(*args)
+ super
+ end
+ end.new
+
+ ex = nil
+ trace = TracePoint.new(:raise) do |tp|
+ ex = tp.raised_exception
+ end
+ trace.enable {[obj].flatten}
+ assert_nil(ex, bug11465)
+ end
+
def test_permutation_with_callcc
need_continuation
n = 1000