spec/entry_spec.rb in appstats-0.11.7 vs spec/entry_spec.rb in appstats-0.12.1
- old
+ new
@@ -70,27 +70,32 @@
entry.month.should == 01
entry.day.should == 15
entry.hour.should == 10
entry.min.should == 11
entry.sec.should == 12
+ entry.week.should == 2
+ entry.quarter.should == 1
entry.occurred_at = Time.parse("2011-02-16 17:18:19")
entry.year.should == 2011
entry.month.should == 02
entry.day.should == 16
entry.hour.should == 17
entry.min.should == 18
entry.sec.should == 19
+ entry.week.should == 7
+ entry.quarter.should == 1
entry.occurred_at = nil
entry.year.should == nil
entry.month.should == nil
entry.day.should == nil
entry.hour.should == nil
entry.min.should == nil
entry.sec.should == nil
-
+ entry.week.should == nil
+ entry.quarter.should == nil
end
end
describe "#contexts" do
@@ -186,21 +191,21 @@
entry.raw_entry.should == "blah"
entry.occurred_at.should == nil
end
it "should understand an entry without contexts" do
- entry = Entry.create_from_logger_string("0.11.7 setup[:,=,-n] 2010-09-21 23:15:20 action=address_search")
+ entry = Entry.create_from_logger_string("0.12.1 setup[:,=,-n] 2010-09-21 23:15:20 action=address_search")
Entry.count.should == @before_count + 1
entry.action.should == "address_search"
- entry.raw_entry.should == "0.11.7 setup[:,=,-n] 2010-09-21 23:15:20 action=address_search"
+ entry.raw_entry.should == "0.12.1 setup[:,=,-n] 2010-09-21 23:15:20 action=address_search"
entry.occurred_at.should == Time.parse("2010-09-21 23:15:20")
end
it "should understand contexts" do
- entry = Entry.create_from_logger_string("0.11.7 setup[:,=,-n] 2010-09-21 23:15:20 action=address_filter : app_name=Market : server=Live")
+ entry = Entry.create_from_logger_string("0.12.1 setup[:,=,-n] 2010-09-21 23:15:20 action=address_filter : app_name=Market : server=Live")
Entry.count.should == @before_count + 1
entry.action.should == "address_filter"
- entry.raw_entry.should == "0.11.7 setup[:,=,-n] 2010-09-21 23:15:20 action=address_filter : app_name=Market : server=Live"
+ entry.raw_entry.should == "0.12.1 setup[:,=,-n] 2010-09-21 23:15:20 action=address_filter : app_name=Market : server=Live"
entry.occurred_at.should == Time.parse("2010-09-21 23:15:20")
entry.contexts.size.should == 2
entry.contexts[0].context_key = "app_name"
entry.contexts[0].context_value = "Market"
entry.contexts[1].context_key = "server"
\ No newline at end of file