From bd72d06374600cb20bbc85127ab8629dd1b2453c Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Tue, 29 Jan 2008 01:09:49 +0000 Subject: Support retrieving TimeZones with a Duration. TimeZone[-28800] == TimeZone[-480.minutes]. [rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8746 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/time_zone_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activesupport/test') diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb index 23d9e3f4be..c32218cee2 100644 --- a/activesupport/test/time_zone_test.rb +++ b/activesupport/test/time_zone_test.rb @@ -36,6 +36,14 @@ class TimeZoneTest < Test::Unit::TestCase end end + def test_from_integer_to_map + assert_instance_of TimeZone, TimeZone[-28800] # PST + end + + def test_from_duration_to_map + assert_instance_of TimeZone, TimeZone[-480.minutes] # PST + end + TimeZone.all.each do |zone| name = zone.name.downcase.gsub(/[^a-z]/, '_') define_method("test_from_#{name}_to_map") do -- cgit v1.2.3