From 69c8bf73294c1b99389b8e81f7003a88c67ff4cc Mon Sep 17 00:00:00 2001 From: wyhaines Date: Fri, 10 Jul 2009 14:50:32 +0000 Subject: Fixed ostruct recursion inspection. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@24025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ostruct/test_ostruct.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index 24ed17f800..ef83db5d15 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -20,4 +20,12 @@ class TC_OpenStruct < Test::Unit::TestCase o2.instance_eval{@table = {:a => 'b'}} assert_not_equal(o1, o2) end + + def test_inspect + foo = OpenStruct.new + foo.bar = OpenStruct.new + assert_equal('#>', foo.inspect) + foo.bar.foo = foo + assert_equal('#>>', foo.inspect) + end end -- cgit v1.2.3