Permalink
Browse files

Check more carefully for vendored tzinfo

  • Loading branch information...
1 parent 19161e0 commit a72bcdb8aedd8cbfa0efc2ca95fe4c7553227f80 @jeremy jeremy committed Apr 2, 2010
Showing with 6 additions and 3 deletions.
  1. +6 −3 activesupport/test/time_zone_test.rb
@@ -75,13 +75,16 @@ def test_now_enforces_fall_dst_rules
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

0 comments on commit a72bcdb

Please sign in to comment.