aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-04-03 10:56:15 -0700
committerXavier Noria <fxn@hashref.com>2010-04-03 10:56:15 -0700
commit11161e6c96fb6686a33e05ead106b96089ff9790 (patch)
tree35d5618f1a866ce8ba11efd8e6851d2fd7bbf5fc /activesupport/test
parent4996d1a445acd965d0064500ad00d692a742f669 (diff)
parent467d251c3dcbd3e4dd1e785a21d63535b795a64c (diff)
downloadrails-11161e6c96fb6686a33e05ead106b96089ff9790.tar.gz
rails-11161e6c96fb6686a33e05ead106b96089ff9790.tar.bz2
rails-11161e6c96fb6686a33e05ead106b96089ff9790.zip
Merge commit 'rails/master'
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/time_zone_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb
index ce43c6507d..68027f7c94 100644
--- a/activesupport/test/time_zone_test.rb
+++ b/activesupport/test/time_zone_test.rb
@@ -75,6 +75,14 @@ class TimeZoneTest < Test::Unit::TestCase
end
end
+ def test_unknown_timezones_delegation_to_tzinfo
+ zone = ActiveSupport::TimeZone['America/Montevideo']
+ assert_equal ActiveSupport::TimeZone, zone.class
+ assert_equal zone.object_id, ActiveSupport::TimeZone['America/Montevideo'].object_id
+ assert_equal Time.utc(2010, 1, 31, 22), zone.utc_to_local(Time.utc(2010, 2)) # daylight saving offset -0200
+ assert_equal Time.utc(2010, 3, 31, 21), zone.utc_to_local(Time.utc(2010, 4)) # standard offset -0300
+ end
+
def test_today
Time.stubs(:now).returns(Time.utc(2000, 1, 1, 4, 59, 59)) # 1 sec before midnight Jan 1 EST
assert_equal Date.new(1999, 12, 31), ActiveSupport::TimeZone['Eastern Time (US & Canada)'].today