spec/summary_spec.rb in redistat-0.2.6 vs spec/summary_spec.rb in redistat-0.3.0
- old
+ new
@@ -11,23 +11,23 @@
@key = Redistat::Key.new(@scope, @label, @date, {:depth => :day})
@stats = {"views" => 3, "visitors" => 2}
end
it "should update a single summary properly" do
- Redistat::Summary.update(@key, @stats, :hour)
+ Redistat::Summary.send(:update_fields, @key, @stats, :hour)
summary = db.hgetall(@key.to_s(:hour))
summary.should have(2).items
summary["views"].should == "3"
summary["visitors"].should == "2"
- Redistat::Summary.update(@key, @stats, :hour)
+ Redistat::Summary.send(:update_fields, @key, @stats, :hour)
summary = db.hgetall(@key.to_s(:hour))
summary.should have(2).items
summary["views"].should == "6"
summary["visitors"].should == "4"
- Redistat::Summary.update(@key, {"views" => -4, "visitors" => -3}, :hour)
+ Redistat::Summary.send(:update_fields, @key, {"views" => -4, "visitors" => -3}, :hour)
summary = db.hgetall(@key.to_s(:hour))
summary.should have(2).items
summary["views"].should == "2"
summary["visitors"].should == "1"
end
@@ -46,10 +46,10 @@
end
end
it "should update summaries even if no label is set" do
key = Redistat::Key.new(@scope, nil, @date, {:depth => :day})
- Redistat::Summary.update(key, @stats, :hour)
+ Redistat::Summary.send(:update_fields, key, @stats, :hour)
summary = db.hgetall(key.to_s(:hour))
summary.should have(2).items
summary["views"].should == "3"
summary["visitors"].should == "2"
end