diff --git a/lib/redistat/core_ext/time.rb b/lib/redistat/core_ext/time.rb index c264d49..043e8be 100644 --- a/lib/redistat/core_ext/time.rb +++ b/lib/redistat/core_ext/time.rb @@ -1,27 +1,3 @@ class Time include Redistat::DateHelper end - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/redistat/date.rb b/lib/redistat/date.rb index e4b258e..8dc78d2 100644 --- a/lib/redistat/date.rb +++ b/lib/redistat/date.rb @@ -26,14 +26,17 @@ module Redistat def to_t ::Time.local(@year, @month, @day, @hour, @min, @sec, @usec) end + alias :to_time :to_t def to_d ::Date.civil(@year, @month, @day) end + alias :to_date :to_d def to_i to_time.to_i end + alias :to_integer :to_i def to_s(depth = nil) depth ||= :sec @@ -49,12 +52,7 @@ module Redistat end output end - - alias :to_time :to_t - alias :to_date :to_d - alias :to_integer :to_i - alias :to_string :to_s - + alias :to_string :to_s private diff --git a/spec/summary_spec.rb b/spec/summary_spec.rb index a6db27e..68dde3b 100644 --- a/spec/summary_spec.rb +++ b/spec/summary_spec.rb @@ -1,6 +1,7 @@ require "spec_helper" describe Redistat::Summary do + include Redistat::Database before(:each) do db.flushdb @@ -45,10 +46,27 @@ describe Redistat::Summary do end end - it "should fetch summary collections for date ranges" - - def db - Redistat.redis - end - -end \ No newline at end of file +end + + + + + + + + + + + + + + + + + + + + + + +