Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix some non-determinism in specs, caught by Travis

  • Loading branch information...
commit c33bc8e4969ceedc8b79565b852b53b1a5307523 1 parent 12f5996
@jeremyevans authored
View
5 spec/extensions/eager_each_spec.rb
@@ -17,7 +17,10 @@
ds.each{|c| a << c}
a.should == [@c.load(:id=>1, :parent_id=>nil), @c.load(:id=>2, :parent_id=>nil)]
a.map{|c| c.associations[:children]}.should == [[@c.load(:id=>3, :parent_id=>1), @c.load(:id=>4, :parent_id=>1)], [@c.load(:id=>5, :parent_id=>2), @c.load(:id=>6, :parent_id=>2)]]
- @c.db.sqls.should == ['SELECT * FROM items', 'SELECT * FROM items WHERE (items.parent_id IN (1, 2))']
+ sqls = @c.db.sqls
+ sqls.shift.should == 'SELECT * FROM items'
+ ['SELECT * FROM items WHERE (items.parent_id IN (1, 2))',
+ 'SELECT * FROM items WHERE (items.parent_id IN (2, 1))'].should include(sqls.pop)
end
it "should make #each on an eager_graph dataset do eager loading" do
View
5 spec/extensions/single_table_inheritance_spec.rb
@@ -193,7 +193,7 @@ class ::StiTest4 < ::StiTest2; end
StiTest2.dataset.row_proc.call(:kind=>1).should be_a_instance_of(StiTest3)
StiTest2.dataset.row_proc.call(:kind=>2).should be_a_instance_of(StiTest4)
- StiTest3.create.kind.should == 1
+ [0,1].should include(StiTest3.create.kind)
StiTest4.create.kind.should == 2
end
@@ -214,7 +214,8 @@ class ::StiTest3 < ::StiTest2; end
class ::StiTest4 < ::StiTest2; end
StiTest2.dataset.sql.should == "SELECT * FROM sti_test2s"
- StiTest3.dataset.sql.should == "SELECT * FROM sti_test2s WHERE (sti_test2s.kind IN (0, 1))"
+ ["SELECT * FROM sti_test2s WHERE (sti_test2s.kind IN (0, 1))",
+ "SELECT * FROM sti_test2s WHERE (sti_test2s.kind IN (1, 0))"].should include(StiTest3.dataset.sql)
end
it "should honor a :key_chooser" do
Please sign in to comment.
Something went wrong with that request. Please try again.