aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2008-01-29 01:09:49 +0000
committerRick Olson <technoweenie@gmail.com>2008-01-29 01:09:49 +0000
commitbd72d06374600cb20bbc85127ab8629dd1b2453c (patch)
tree6bfc7c9da6c53c5288d36aaa6b03dd421116d1e0 /activesupport/test
parent859ca3a1ea23684c02c39de057e1810b05bd6a46 (diff)
downloadrails-bd72d06374600cb20bbc85127ab8629dd1b2453c.tar.gz
rails-bd72d06374600cb20bbc85127ab8629dd1b2453c.tar.bz2
rails-bd72d06374600cb20bbc85127ab8629dd1b2453c.zip
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
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/time_zone_test.rb8
1 files changed, 8 insertions, 0 deletions
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