fixed dummy time and added spec

This commit is contained in:
Adam Meehan
2008-07-11 17:41:07 +10:00
parent 20ed2b1633
commit 1a0a35836f
4 changed files with 34 additions and 3 deletions

31
spec/dummy_time_spec.rb Normal file
View File

@@ -0,0 +1,31 @@
require File.dirname(__FILE__) + '/spec_helper'
describe ValidatesTimeliness::CoreExtensions::Date do
before do
@a_date = Date.new(2008, 7, 1)
end
it "should " do
@a_date.to_dummy_time.should == Time.mktime(2000,1,1,0,0,0)
end
end
describe ValidatesTimeliness::CoreExtensions::Time do
before do
@a_time = Time.mktime(2008, 7, 1, 2, 3, 4)
end
it "should " do
@a_time.to_dummy_time.should == Time.mktime(2000,1,1,2,3,4)
end
end
describe ValidatesTimeliness::CoreExtensions::DateTime do
before do
@a_datetime = DateTime.new(2008, 7, 1, 2, 3, 4)
end
it "should " do
@a_datetime.to_dummy_time.should == Time.mktime(2000,1,1,2,3,4)
end
end