8000 More spec fixup to work with both 1.8.7 and 1.9.3. · paramadeep/recursive-open-struct@91327a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 91327a1

Browse files
committed
More spec fixup to work with both 1.8.7 and 1.9.3.
1 parent da94057 commit 91327a1

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

spec/recursive_open_struct_spec.rb

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
end # describe handling loops in the origin Hashes
7878

7979
describe 'recursing over arrays' do
80-
let(:blah_list) { [ { :id => '1' }, { :id => '2' }, 'baz' ] }
80+
let(:blah_list) { [ { :foo => '1' }, { :foo => '2' }, 'baz' ] }
8181
let(:h) { { :blah => blah_list } }
8282

8383
context "when recursing over arrays is enabled" do
@@ -86,8 +86,8 @@
8686
end
8787

8888
it { @ros.blah.length.should == 3 }
89-
it { @ros.blah[0].id.should == '1' }
90-
it { @ros.blah[1].id.should == '2' }
89+
it { @ros.blah[0].foo.should == '1' }
90+
it { @ros.blah[1].foo.should == '2' }
9191
it { @ros.blah_as_a_hash.should == blah_list }
9292
it { @ros.blah[2].should == 'baz' }
9393
end # when recursing over arrays is enabled
@@ -98,8 +98,8 @@
9898
end
9999

100100
it { @ros.blah.length.should == 3 }
101-
it { @ros.blah[0].should == { :id => '1' } }
102-
it { @ros.blah[0][:id].should == '1' }
101+
it { @ros.blah[0].should == { :foo => '1' } }
102+
it { @ros.blah[0][:foo].should == '1' }
103103
end # when recursing over arrays is disabled
104104

105105
end # recursing over arrays
@@ -144,7 +144,31 @@
144144
QUOTE
145145
@io = StringIO.new
146146
@ros.debug_inspect(@io)
147-
@io.string.should == @output
147+
@io.string.should match /^a = "b"$/
148+
@io.string.should match /^h1\.$/
149+
@io.string.should match /^ a = "a"$/
150+
@io.string.should match /^ h2\.$/
151+
@io.string.should match /^ a = "b"$/
152+
@io.string.should match /^ h1\.$/
153+
@io.string.should match /^ a = "a"$/
154+
@io.string.should match /^ h2\.$/
155+
@io.string.should match /^ a = "b"$/
156+
@io.string.should match /^ h1\.$/
157+
@io.string.should match /^ a = "a"$/
158+
@io.string.should match /^ h2\.$/
159+
@io.string.should match /^ a = "b"$/
< 8E4A code>160+
@io.string.should match /^ h1\.$/
161+
@io.string.should match /^ a = "a"$/
162+
@io.string.should match /^ h2\.$/
163+
@io.string.should match /^ a = "b"$/
164+
@io.string.should match /^ h1\.$/
165+
@io.string.should match /^ a = "a"$/
166+
@io.string.should match /^ h2\.$/
167+
@io.string.should match /^ a = "b"$/
168+
@io.string.should match /^ h1\.$/
169+
@io.string.should match /^ a = "a"$/
170+
@io.string.should match /^ h2\.$/
171+
@io.string.should match /^ \(recursion limit reached\)$/
148172
end
149173
end # additionnel features
150174

0 commit comments

Comments
 (0)
0