summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-10 14:50:32 +0000
committerwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-10 14:50:32 +0000
commit69c8bf73294c1b99389b8e81f7003a88c67ff4cc (patch)
tree553ab1b27bbe1be02df9239ea5c56bedc7af9cf0 /test
parente803164d252346a9631da26de8a9460dfd411957 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ostruct/test_ostruct.rb8
1 files changed, 8 insertions, 0 deletions
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('#<OpenStruct bar=#<OpenStruct>>', foo.inspect)
+ foo.bar.foo = foo
+ assert_equal('#<OpenStruct bar=#<OpenStruct foo=#<OpenStruct ...>>>', foo.inspect)
+ end
end