mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 13:26:39 +00:00
Redistat::Date can now take the output from it's
own #to_s method as input.
This commit is contained in:
@@ -31,6 +31,14 @@ describe Redistat::Date do
|
||||
[:year, :month, :day, :hour, :min, :sec].each { |k| rdate.send(k).should == now.send(k) }
|
||||
end
|
||||
|
||||
it "should initialize from Redistat date String" do
|
||||
now = Time.now
|
||||
rdate = Redistat::Date.new(now.to_s)
|
||||
[:year, :month, :day, :hour, :min, :sec].each { |k|
|
||||
rdate.to_s(k).should == Redistat::Date.new(rdate.to_s(k)).to_s(k)
|
||||
}
|
||||
end
|
||||
|
||||
it "should convert to Time object" do
|
||||
now = Time.now
|
||||
rdate = Redistat::Date.new(now)
|
||||
|
||||
Reference in New Issue
Block a user