mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 13:26:39 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user