diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ostruct/test_ostruct.rb | 8 |
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 |