aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/time_zone_test.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-04-15 01:10:04 -0300
committerJeremy Kemper <jeremy@bitsweat.net>2010-04-14 21:15:15 -0700
commita0cc94b32e5b4e4dce50787eed1208406f99ea82 (patch)
tree2be64d72a3e0a579be9b6b211f42dbe316bd62eb /activesupport/test/time_zone_test.rb
parente79193f852238816a9eeb26fbf1e94b369911718 (diff)
downloadrails-a0cc94b32e5b4e4dce50787eed1208406f99ea82.tar.gz
rails-a0cc94b32e5b4e4dce50787eed1208406f99ea82.tar.bz2
rails-a0cc94b32e5b4e4dce50787eed1208406f99ea82.zip
utc_offset returns nil for unknown zones
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/test/time_zone_test.rb')
-rw-r--r--activesupport/test/time_zone_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb
index 61c59060f3..58035ebbcd 100644
--- a/activesupport/test/time_zone_test.rb
+++ b/activesupport/test/time_zone_test.rb
@@ -274,9 +274,15 @@ class TimeZoneTest < Test::Unit::TestCase
assert_raise(ArgumentError) { ActiveSupport::TimeZone[false] }
end
- def test_unknown_zone_shouldnt_have_tzinfo
+ def test_unknown_zone_shouldnt_have_tzinfo_nor_utc_offset
zone = ActiveSupport::TimeZone.create("bogus")
assert_nil zone.tzinfo
+ assert_nil zone.utc_offset
+ end
+
+ def test_unknown_zone_with_utc_offset
+ zone = ActiveSupport::TimeZone.create("bogus", -21_600)
+ assert_equal -21_600, zone.utc_offset
end
def test_new