specs for Redistat::Date.to_time/to_date

This commit is contained in:
2010-07-19 02:29:05 +03:00
parent e4c46ca958
commit 3357667e2a

View File

@@ -21,6 +21,18 @@ describe Redistat::Date do
[:year, :month, :day, :hour, :min, :sec].each { |k| rdate.send(k).should == now.send(k) }
end
it "should convert to Time object" do
now = Time.now
rdate = Redistat::Date.new(now)
rdate.to_time.to_s.should == now.to_s
end
it "should convert to Date object" do
today = Date.today
rdate = Redistat::Date.new(today)
rdate.to_date.to_s.should == today.to_s
end
it "should convert to string with correct depths" do
today = Date.today
rdate = Redistat::Date.new(today)