aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/time_zone_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/time_zone_test.rb')
-rw-r--r--activesupport/test/time_zone_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb
index 68027f7c94..3b7fbb7808 100644
--- a/activesupport/test/time_zone_test.rb
+++ b/activesupport/test/time_zone_test.rb
@@ -274,6 +274,17 @@ class TimeZoneTest < Test::Unit::TestCase
assert_raise(ArgumentError) { ActiveSupport::TimeZone[false] }
end
+ 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
assert_equal ActiveSupport::TimeZone["Central Time (US & Canada)"], ActiveSupport::TimeZone.new("Central Time (US & Canada)")
end