aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_with_zone_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-04-20 10:54:28 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2010-04-20 10:54:37 -0700
commit9934738ed5f05fe78cdf2c4cf5fcaae7227d5e1e (patch)
treeddaaff12217438a16e85ddc465fde27a418f2417 /activesupport/test/core_ext/time_with_zone_test.rb
parenta90a076613c32f952e4d3e1bb7c828572e808145 (diff)
downloadrails-9934738ed5f05fe78cdf2c4cf5fcaae7227d5e1e.tar.gz
rails-9934738ed5f05fe78cdf2c4cf5fcaae7227d5e1e.tar.bz2
rails-9934738ed5f05fe78cdf2c4cf5fcaae7227d5e1e.zip
Switch to TimezoneProxy for later support of deferred TZ loading
Diffstat (limited to 'activesupport/test/core_ext/time_with_zone_test.rb')
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb
index d88f79ae4f..a808a25821 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -823,9 +823,12 @@ class TimeWithZoneMethodsForTimeAndDateTimeTest < Test::Unit::TestCase
assert_equal(-18_000, Time.zone.utc_offset)
end
- def test_time_zone_setter_with_non_identifying_argument_returns_nil
+ def test_time_zone_setter_with_invalid_zone
Time.zone = 'foo'
- assert_equal nil, Time.zone
+ assert_not_nil Time.zone
+ assert_equal 'foo', Time.zone.name
+ assert_raise(TZInfo::InvalidTimezoneIdentifier) { Time.zone.utc_offset }
+
Time.zone = -15.hours
assert_equal nil, Time.zone
end