restructured Redistat::Date a bit

This commit is contained in:
2010-07-19 11:18:25 +03:00
parent 7d256d5e24
commit e01ae94a5e
2 changed files with 25 additions and 22 deletions

View File

@@ -4,14 +4,14 @@ describe Redistat::Date do
it "should initialize from Time object" do
now = Time.now
[Redistat::Date.new(now), now.to_redistat].each do |rdate|
[Redistat::Date.new(now), now.to_rs].each do |rdate|
[:year, :month, :day, :hour, :min, :sec].each { |k| rdate.send(k).should == now.send(k) }
end
end
it "should initialize from Date object" do
today = Date.today
[Redistat::Date.new(today), today.to_redistat].each do |rdate|
[Redistat::Date.new(today), today.to_rs].each do |rdate|
[:year, :month, :day].each { |k| rdate.send(k).should == today.send(k) }
[:hour, :min, :sec].each { |k| rdate.send(k).should == 0 }
end