Permalink
Browse files

fixed widget spec

  • Loading branch information...
1 parent 5ccb6ee commit ed9b112ce29cb2b8d98fc33214b215c726c16cfe Paul Asmuth committed Dec 18, 2011
Showing with 18 additions and 18 deletions.
  1. +18 −18 spec/widget_spec.rb
View
@@ -41,65 +41,65 @@
it "should raise an error if two gauges with different ticks are added" do
lambda{
- widget = FnordMetric::Widget.new(
+ widget = FnordMetric::TimelineWidget.new(
:title => "My Widget",
:gauges => [@gauge1, @gauge2]
)
}.should raise_error
end
it "should generate the correct default range for daily graphs without include current" do
- widget = FnordMetric::Widget.new(
+ widget = FnordMetric::TimelineWidget.new(
:title => "My Widget",
:include_current => false,
:gauges => [@gauge1]
)
range = widget.default_range(Time.utc(1992,01,13,18,23,23))
- Time.at(range.last).utc.should == Time.utc(1992,01,13,00,00)
- Time.at(range.first).utc.should == Time.utc(1991,12,14,00,00)
+ Time.at(range.last).utc.should == Time.utc(1992,01,12,00,00)
+ Time.at(range.first).utc.should == Time.utc(1991,12,13,00,00)
end
it "should generate the correct default range for daily graphs with include current" do
- widget = FnordMetric::Widget.new(
+ widget = FnordMetric::TimelineWidget.new(
:title => "My Widget",
:gauges => [@gauge1]
)
range = widget.default_range(Time.utc(1992,01,13,18,23,23))
- Time.at(range.last).utc.should == Time.utc(1992,01,14,00,00)
- Time.at(range.first).utc.should == Time.utc(1991,12,15,00,00)
+ Time.at(range.last).utc.should == Time.utc(1992,01,13,00,00)
+ Time.at(range.first).utc.should == Time.utc(1991,12,14,00,00)
end
it "should generate the correct default range for hourly graphs with include current" do
- widget = FnordMetric::Widget.new(
+ widget = FnordMetric::TimelineWidget.new(
:title => "My Widget",
:gauges => [@gauge2]
)
range = widget.default_range(Time.utc(1992,01,13,18,23,23))
- Time.at(range.last).utc.should == Time.utc(1992,01,13,19,00)
- Time.at(range.first).utc.should == Time.utc(1992,01,12,19,00)
+ Time.at(range.last).utc.should == Time.utc(1992,01,13,18,00)
+ Time.at(range.first).utc.should == Time.utc(1992,01,12,18,00)
end
it "should generate the correct default range for hourly graphs with include current" do
- widget = FnordMetric::Widget.new(
+ widget = FnordMetric::TimelineWidget.new(
:title => "My Widget",
:include_current => false,
:gauges => [@gauge2]
)
range = widget.default_range(Time.utc(1992,01,13,18,23,23))
- Time.at(range.last).utc.should == Time.utc(1992,01,13,18,00)
- Time.at(range.first).utc.should == Time.utc(1992,01,12,18,00)
+ Time.at(range.last).utc.should == Time.utc(1992,01,13,17,00)
+ Time.at(range.first).utc.should == Time.utc(1992,01,12,17,00)
end
it "should generate the correct ticks" do
- widget = FnordMetric::Widget.new(
+ widget = FnordMetric::TimelineWidget.new(
:title => "My Widget",
:gauges => [@gauge2]
)
Delorean.time_travel_to(Time.utc(1992,01,13,18,23,23)) do
- Time.at(widget.ticks[0]).should == Time.utc(1992,01,12,19,00)
- Time.at(widget.ticks[1]).should == Time.utc(1992,01,12,20,00)
- Time.at(widget.ticks[-1]).should == Time.utc(1992,01,13,19,00)
- Time.at(widget.ticks[-2]).should == Time.utc(1992,01,13,18,00)
+ Time.at(widget.ticks[0]).utc.should == Time.utc(1992,01,12,18,00)
+ Time.at(widget.ticks[1]).utc.should == Time.utc(1992,01,12,19,00)
+ Time.at(widget.ticks[-1]).utc.should == Time.utc(1992,01,13,18,00)
+ Time.at(widget.ticks[-2]).utc.should == Time.utc(1992,01,13,17,00)
end
end

0 comments on commit ed9b112

Please sign in to comment.