From 15467a43f5e0c107d5048950d1718ccccbbaf01e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 22 Sep 2007 17:58:31 +0000 Subject: Fix tests across DST (closes #9020) [mpalmer] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7557 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/core_ext/time_ext_test.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'activesupport/test') diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index 8ab84baa5d..88fd16531e 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -250,11 +250,13 @@ class TimeExtCalculationsTest < Test::Unit::TestCase end def test_next_week - assert_equal Time.local(2005,2,28), Time.local(2005,2,22,15,15,10).next_week - assert_equal Time.local(2005,2,29), Time.local(2005,2,22,15,15,10).next_week(:tuesday) - assert_equal Time.local(2005,3,4), Time.local(2005,2,22,15,15,10).next_week(:friday) - assert_equal Time.local(2006,10,30), Time.local(2006,10,23,0,0,0).next_week - assert_equal Time.local(2006,11,1), Time.local(2006,10,23,0,0,0).next_week(:wednesday) + with_timezone 'US/Eastern' do + assert_equal Time.local(2005,2,28), Time.local(2005,2,22,15,15,10).next_week + assert_equal Time.local(2005,2,29), Time.local(2005,2,22,15,15,10).next_week(:tuesday) + assert_equal Time.local(2005,3,4), Time.local(2005,2,22,15,15,10).next_week(:friday) + assert_equal Time.local(2006,10,30), Time.local(2006,10,23,0,0,0).next_week + assert_equal Time.local(2006,11,1), Time.local(2006,10,23,0,0,0).next_week(:wednesday) + end end def test_next_week_near_daylight_start -- cgit v1.2.3