From e4645e00b7a427f32e470b4ad3fe494b698f725d Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Fri, 28 Mar 2008 01:57:41 +0000 Subject: TimeWithZone#usec returns 0 instead of error when DateTime is wrapped git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9105 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/core_ext/time_with_zone_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/test/core_ext/time_with_zone_test.rb') diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb index 70b3d90bd6..4fe1be3ed6 100644 --- a/activesupport/test/core_ext/time_with_zone_test.rb +++ b/activesupport/test/core_ext/time_with_zone_test.rb @@ -326,6 +326,13 @@ uses_tzinfo 'TimeWithZoneTest' do end end + def test_usec_returns_0_when_datetime_is_wrapped + silence_warnings do # silence warnings raised by tzinfo gem + twz = ActiveSupport::TimeWithZone.new(DateTime.civil(2000), @time_zone) + assert_equal 0, twz.usec + end + end + def test_utc_to_local_conversion_saves_period_in_instance_variable silence_warnings do # silence warnings raised by tzinfo gem assert_nil @twz.instance_variable_get('@period') -- cgit v1.2.3