Permalink
Browse files

Fix integration tests for group_and_count change

  • Loading branch information...
1 parent 8cf13f3 commit 2c176ca1700d9770a4c43cd3f38f84372b5f2f77 @jeremyevans committed Mar 19, 2010
Showing with 8 additions and 8 deletions.
  1. +8 −8 spec/integration/dataset_test.rb
@@ -540,23 +540,23 @@
end
it "#group_and_count should return a grouping by count" do
- @ds.group_and_count(:a).all.should == []
+ @ds.group_and_count(:a).order(:count).all.should == []
@ds.insert(20, 10)
- @ds.group_and_count(:a).all.each{|h| h[:count] = h[:count].to_i}.should == [{:a=>20, :count=>1}]
+ @ds.group_and_count(:a).order(:count).all.each{|h| h[:count] = h[:count].to_i}.should == [{:a=>20, :count=>1}]
@ds.insert(20, 30)
- @ds.group_and_count(:a).all.each{|h| h[:count] = h[:count].to_i}.should == [{:a=>20, :count=>2}]
+ @ds.group_and_count(:a).order(:count).all.each{|h| h[:count] = h[:count].to_i}.should == [{:a=>20, :count=>2}]
@ds.insert(30, 30)
- @ds.group_and_count(:a).all.each{|h| h[:count] = h[:count].to_i}.should == [{:a=>30, :count=>1}, {:a=>20, :count=>2}]
+ @ds.group_and_count(:a).order(:count).all.each{|h| h[:count] = h[:count].to_i}.should == [{:a=>30, :count=>1}, {:a=>20, :count=>2}]
end
it "#group_and_count should support column aliases" do
- @ds.group_and_count(:a___c).all.should == []
+ @ds.group_and_count(:a___c).order(:count).all.should == []
@ds.insert(20, 10)
- @ds.group_and_count(:a___c).all.each{|h| h[:count] = h[:count].to_i}.should == [{:c=>20, :count=>1}]
+ @ds.group_and_count(:a___c).order(:count).all.each{|h| h[:count] = h[:count].to_i}.should == [{:c=>20, :count=>1}]
@ds.insert(20, 30)
- @ds.group_and_count(:a___c).all.each{|h| h[:count] = h[:count].to_i}.should == [{:c=>20, :count=>2}]
+ @ds.group_and_count(:a___c).order(:count).all.each{|h| h[:count] = h[:count].to_i}.should == [{:c=>20, :count=>2}]
@ds.insert(30, 30)
- @ds.group_and_count(:a___c).all.each{|h| h[:count] = h[:count].to_i}.should == [{:c=>30, :count=>1}, {:c=>20, :count=>2}]
+ @ds.group_and_count(:a___c).order(:count).all.each{|h| h[:count] = h[:count].to_i}.should == [{:c=>30, :count=>1}, {:c=>20, :count=>2}]
end
cspecify "#range should return the range between the maximum and minimum values", :sqlite do

0 comments on commit 2c176ca

Please sign in to comment.