aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index d0924844b1..d509a9bfe2 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2583,5 +2583,17 @@ End
end
end
end
+
+ def test_puts_recursive_ary
+ bug5986 = '[ruby-core:42444]'
+ c = Class.new {
+ def to_ary
+ [self]
+ end
+ }
+ s = StringIO.new
+ s.puts(c.new)
+ assert_equal("[...]\n", s.string, bug5986)
+ end
end