Redistat::Date's hour, min, and sec attributes are

set all set to 0 instead of nil when the object is
initialized from a Date object
This commit is contained in:
2010-07-19 10:37:40 +03:00
parent 42de09a95b
commit df9d8a055d
2 changed files with 4 additions and 1 deletions

View File

@@ -32,6 +32,9 @@ module Redistat
[:year, :month, :day].each do |k|
self.send("#{k}=", input.send(k))
end
[:hour, :min, :sec].each do |k|
self.send("#{k}=", 0)
end
end
def to_date

View File

@@ -13,7 +13,7 @@ describe Redistat::Date do
today = Date.today
[Redistat::Date.new(today), today.to_redistat].each do |rdate|
[:year, :month, :day].each { |k| rdate.send(k).should == today.send(k) }
[:hour, :min, :sec].each { |k| rdate.send(k).should == nil }
[:hour, :min, :sec].each { |k| rdate.send(k).should == 0 }
end
end