diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb index b2bdea2934..2802ffd54a 100644 --- a/activesupport/test/time_zone_test.rb +++ b/activesupport/test/time_zone_test.rb @@ -75,13 +75,16 @@ class TimeZoneTest < Test::Unit::TestCase def test_unknown_timezones_delegation_to_tzinfo zone = ActiveSupport::TimeZone['America/Montevideo'] - if defined?(TZInfo::TimeZone) + begin + require 'tzinfo/country' + rescue LoadError + # using vendored tzinfo which doesn't have tzinfo/country + assert_nil zone + else 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 - else - assert_nil zone end end