aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_with_zone_test.rb
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-03-28 02:10:36 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-03-28 02:10:36 +0000
commit129d94477b1bb4478d1d8ceaed2a0f9a615e2d23 (patch)
treec057c9eded2ad6bdfc41a0ac05d02631135eadad /activesupport/test/core_ext/time_with_zone_test.rb
parente4645e00b7a427f32e470b4ad3fe494b698f725d (diff)
downloadrails-129d94477b1bb4478d1d8ceaed2a0f9a615e2d23.tar.gz
rails-129d94477b1bb4478d1d8ceaed2a0f9a615e2d23.tar.bz2
rails-129d94477b1bb4478d1d8ceaed2a0f9a615e2d23.zip
TimeWithZone time conversions don't need to be wrapped in TimeOrDateTime, because TZInfo does this internally
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9106 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/time_with_zone_test.rb')
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb
index 4fe1be3ed6..5a645dc765 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -372,6 +372,18 @@ uses_tzinfo 'TimeWithZoneTest' do
assert_equal ruby_19_or_greater, @twz.respond_to?(name)
end
end
+
+ def test_utc_to_local_conversion_with_far_future_datetime
+ silence_warnings do # silence warnings raised by tzinfo gem
+ assert_equal [0,0,19,31,12,2049], ActiveSupport::TimeWithZone.new(DateTime.civil(2050), @time_zone).to_a[0,6]
+ end
+ end
+
+ def test_local_to_utc_conversion_with_far_future_datetime
+ silence_warnings do # silence warnings raised by tzinfo gem
+ assert_equal DateTime.civil(2050).to_f, ActiveSupport::TimeWithZone.new(nil, @time_zone, DateTime.civil(2049,12,31,19)).to_f
+ end
+ end
end
class TimeWithZoneMethodsForTimeAndDateTimeTest < Test::Unit::TestCase