diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-11-05 22:29:11 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-11-05 22:29:11 +0000 |
commit | 47576a646bd99d431f4217b20b7625bdd3444171 (patch) | |
tree | 1e2912a07b1cf0458ddc090c37c67001f124b7ee /activesupport/test/core_ext/time_ext_test.rb | |
parent | 800b69b6adab2e2ea90b66fd2b37ed05f973b1d5 (diff) | |
download | rails-47576a646bd99d431f4217b20b7625bdd3444171.tar.gz rails-47576a646bd99d431f4217b20b7625bdd3444171.tar.bz2 rails-47576a646bd99d431f4217b20b7625bdd3444171.zip |
Cater for DST changes when converting Times to DateTimes. Closes #10068 [gbuesing]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8076 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/time_ext_test.rb')
-rw-r--r-- | activesupport/test/core_ext/time_ext_test.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index 9965e2574a..8ead0d7fe6 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -312,7 +312,9 @@ class TimeExtCalculationsTest < Test::Unit::TestCase assert_equal "17:44", time.to_s(:time) assert_equal "February 21, 2005 17:44", time.to_s(:long) assert_equal "February 21st, 2005 17:44", time.to_s(:long_ordinal) - assert_equal "Mon, 21 Feb 2005 17:44:30 +0000", time.to_s(:rfc822) + with_timezone "UTC" do + assert_equal "Mon, 21 Feb 2005 17:44:30 +0000", time.to_s(:rfc822) + end end def test_custom_date_format @@ -387,8 +389,8 @@ class TimeExtCalculationsTest < Test::Unit::TestCase def test_local_time assert_equal Time.local_time(2005, 2, 21, 17, 44, 30), Time.local(2005, 2, 21, 17, 44, 30) - assert_equal Time.local_time(2039, 2, 21, 17, 44, 30), DateTime.civil(2039, 2, 21, 17, 44, 30, DateTime.now.offset, 0) - assert_equal Time.local_time(1901, 2, 21, 17, 44, 30), DateTime.civil(1901, 2, 21, 17, 44, 30, DateTime.now.offset, 0) + assert_equal Time.local_time(2039, 2, 21, 17, 44, 30), DateTime.civil(2039, 2, 21, 17, 44, 30, DateTime.local_offset, 0) + assert_equal Time.local_time(1901, 2, 21, 17, 44, 30), DateTime.civil(1901, 2, 21, 17, 44, 30, DateTime.local_offset, 0) end def test_next_month_on_31st |