8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db6f22b commit 4bad711Copy full SHA for 4bad711
spec/recursive_open_struct_spec.rb
@@ -59,5 +59,20 @@
59
@ros.blah_as_a_hash.should == { :another => 'value' }
60
end
61
62
+ describe "handling loops in the origin Hashes" do
63
+ before(:each) do
64
+ h1 = { :a => 'a'}
65
+ h2 = { :a => 'b', :h1 => h1 }
66
+ h1[:h2] = h2
67
+ @ros = RecursiveOpenStruct.new(h2)
68
+ end
69
+
70
+ it { @ros.h1.a.should == 'a' }
71
+ it { @ros.h1.h2.a.should == 'b' }
72
+ it { @ros.h1.h2.h1.a.should == 'a' }
73
+ it { @ros.h1.h2.h1.h2.a.should == 'b' }
74
+ it { @ros.h1.should == @ros.h1.h2.h1 }
75
+ it { @ros.h1.should_not == @ros.h1.h2 }
76
+ end # describe handling loops in the origin Hashes
77
end # recursive behavior
78
end # describe RecursiveOpenStruct
0 commit comments