1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add test for TimeWithZone#to_i with wrapped DateTime

This commit is contained in:
Geoff Buesing 2009-12-15 08:28:24 -06:00
parent 2ae8300489
commit a4b19277b2

View file

@ -284,6 +284,12 @@ class TimeWithZoneTest < Test::Unit::TestCase
assert_equal 946684800, result
assert result.is_a?(Integer)
end
def test_to_i_with_wrapped_datetime
datetime = DateTime.civil(2000, 1, 1, 0)
twz = ActiveSupport::TimeWithZone.new(datetime, @time_zone)
assert_equal 946684800, twz.to_i
end
def test_to_time
assert_equal @twz, @twz.to_time