aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/time_zone_test.rb
diff options
context:
space:
mode:
authorbrainopia <brainopia@evilmartians.com>2015-01-04 19:39:49 +0300
committerbrainopia <brainopia@evilmartians.com>2015-01-04 20:08:18 +0300
commitab4c900656db249caa6ff363a932168695b9021e (patch)
tree5b5ed0b8d45fd5be33378ab232b921a6480fbe27 /activesupport/test/time_zone_test.rb
parent6489a84eb69162ccefac106d08bae1c31a2b4fa5 (diff)
downloadrails-ab4c900656db249caa6ff363a932168695b9021e.tar.gz
rails-ab4c900656db249caa6ff363a932168695b9021e.tar.bz2
rails-ab4c900656db249caa6ff363a932168695b9021e.zip
Use directly TZInfo::Timezone without proxy
Since real timezone is loaded anyway in `#utc_offset` which is called during `#create`
Diffstat (limited to 'activesupport/test/time_zone_test.rb')
-rw-r--r--activesupport/test/time_zone_test.rb13
1 files changed, 4 insertions, 9 deletions
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb
index 3e6d9652bb..cd7e184cda 100644
--- a/activesupport/test/time_zone_test.rb
+++ b/activesupport/test/time_zone_test.rb
@@ -395,15 +395,10 @@ class TimeZoneTest < ActiveSupport::TestCase
assert_raise(ArgumentError) { ActiveSupport::TimeZone[false] }
end
- def test_unknown_zone_should_have_tzinfo_but_exception_on_utc_offset
- zone = ActiveSupport::TimeZone.create("bogus")
- assert_instance_of TZInfo::TimezoneProxy, zone.tzinfo
- assert_raise(TZInfo::InvalidTimezoneIdentifier) { 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)
+ def test_unknown_zone_raises_exception
+ assert_raise TZInfo::InvalidTimezoneIdentifier do
+ ActiveSupport::TimeZone.create("bogus")
+ end
end
def test_unknown_zones_dont_store_mapping_keys