Permalink
Browse files

test that unknown zones don't store mapping keys

[#4942]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent b5b42af commit 97a92a4cfddf819357ca09b4a91a5937b044e4d8 @texel texel committed with josevalim Jun 28, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 activesupport/test/time_zone_test.rb
@@ -285,6 +285,11 @@ def test_unknown_zone_with_utc_offset
assert_equal(-21_600, zone.utc_offset)
end
+ def test_unknown_zones_dont_store_mapping_keys
+ ActiveSupport::TimeZone["bogus"]
+ assert !ActiveSupport::TimeZone.zones_map.key?("bogus")
+ end
+
def test_new
assert_equal ActiveSupport::TimeZone["Central Time (US & Canada)"], ActiveSupport::TimeZone.new("Central Time (US & Canada)")
end

0 comments on commit 97a92a4

Please sign in to comment.