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
1 changed files with 6 additions and 0 deletions

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