Permalink
Browse files

Merge pull request #38 from dbrady/master

Remove implicit timezone from time specs
  • Loading branch information...
olbrich committed Apr 2, 2012
2 parents 365be2d + e10cd0f commit f600396047b250f87d1ed9e825d9c3c5d8511036
Showing with 5 additions and 5 deletions.
  1. +5 −5 spec/ruby-units/time_spec.rb
@@ -8,23 +8,23 @@
context ".at" do
subject { Date.new(2011,4,1).to_unit }
- specify { Time.at(subject - Date.new(1970,1,1)).strftime("%D %T").should == "03/31/11 20:00:00"}
+ specify { Time.at(subject - Date.new(1970,1,1)).getutc.strftime("%D %T").should == "04/01/11 00:00:00"}
specify { Time.at(subject - Date.new(1970,1,1), 500).usec.should == 500}
end
-
+
context ".in" do
specify { Time.in("5 min").should be_a Time}
specify { Time.in("5 min").should > Time.now}
end
-
+
context '#to_unit' do
subject { now }
its(:to_unit) { should be_an_instance_of(Unit) }
its('to_unit.units') { should == "s" }
specify { subject.to_unit('h').kind.should == :time}
specify { subject.to_unit('h').units.should == 'h'}
end
-
+
context 'addition (+)' do
specify { (Time.now + 1).should == Time.at(1303656390 + 1)}
specify { (Time.now + Unit("10 min")).should == Time.at(1303656390 + 600)}
@@ -36,4 +36,4 @@
specify { (Time.now - Unit("150 years")).should == Time.parse("1861-04-24 09:46:30 -0500")}
end
-end
+end

0 comments on commit f600396

Please sign in to comment.