summaryrefslogtreecommitdiff
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
commit629d26ef3a41cf585f92ac6d0d8b0a17a47c3daa (patch)
treeb2fe87f9c90528d9506a8dda119954ffa13803bd /test/ruby/test_array.rb
parent24da2db3e1eab67b6ee7be00d75b73beb273a4c4 (diff)
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