spec/lib/tabs/metrics/counter/stats_spec.rb in tabs-0.8.0 vs spec/lib/tabs/metrics/counter/stats_spec.rb in tabs-0.8.1
- old
+ new
@@ -29,9 +29,14 @@
it "max returns the max for the entire set" do
expect(stats.max).to eq 123
end
it "avg returns the average for the entire set" do
- expect(stats.avg).to eq 86.33
+ expect(stats.avg).to eq 86.33333
+ end
+
+ it "avg returns 0 if values empty" do
+ stats = Tabs::Metrics::Counter::Stats.new(period, resolution, [])
+ expect(stats.avg).to be_zero
end
end