diff options
author | kennyj <kennyj@gmail.com> | 2012-09-20 00:51:28 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2012-09-20 22:04:52 +0900 |
commit | 4e715e33aff6274267446d8dcb63da7f60c683b6 (patch) | |
tree | 9dd19d48ba085c91086ec0f14be41e323e67544b /activesupport/test | |
parent | c41f9c1bd5346753dacd1caaf1fd69e09f975c90 (diff) | |
download | rails-4e715e33aff6274267446d8dcb63da7f60c683b6.tar.gz rails-4e715e33aff6274267446d8dcb63da7f60c683b6.tar.bz2 rails-4e715e33aff6274267446d8dcb63da7f60c683b6.zip |
Fix #6962. AS::TimeWithZone#strftime responds incorrectly to %:z and %::z format strings.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/time_zone_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb index 3575175517..8ecfc1e47e 100644 --- a/activesupport/test/time_zone_test.rb +++ b/activesupport/test/time_zone_test.rb @@ -235,6 +235,14 @@ class TimeZoneTest < Test::Unit::TestCase assert_equal "-0500", zone.formatted_offset(false) end + def test_z_format_strings + zone = ActiveSupport::TimeZone['Tokyo'] + twz = zone.now + assert_equal '+0900', twz.strftime('%z') + assert_equal '+09:00', twz.strftime('%:z') + assert_equal '+09:00:00', twz.strftime('%::z') + end + def test_formatted_offset_zero zone = ActiveSupport::TimeZone['London'] assert_equal "+00:00", zone.formatted_offset |