diff options
author | Geoff Buesing <gbuesing@gmail.com> | 2008-03-28 01:57:41 +0000 |
---|---|---|
committer | Geoff Buesing <gbuesing@gmail.com> | 2008-03-28 01:57:41 +0000 |
commit | e4645e00b7a427f32e470b4ad3fe494b698f725d (patch) | |
tree | 0722ca35306af6400f79f6b28a022e3a5aae90ee /activesupport/test | |
parent | 480a7581d4ec87eb745b004d6e4daae98b52cfa5 (diff) | |
download | rails-e4645e00b7a427f32e470b4ad3fe494b698f725d.tar.gz rails-e4645e00b7a427f32e470b4ad3fe494b698f725d.tar.bz2 rails-e4645e00b7a427f32e470b4ad3fe494b698f725d.zip |
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
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/time_with_zone_test.rb | 7 |
1 files changed, 7 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 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') |