diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-21 14:46:33 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-21 14:46:33 +0000 |
commit | 25f8a25c3ea107dcd0688307ac0ce19c4306f6b4 (patch) | |
tree | e2b00181d72285d9b757598de41a64e75d8f87c9 /activesupport/test/core_ext | |
parent | 637642c8b85707779af45f80a104dd84be6a904d (diff) | |
download | rails-25f8a25c3ea107dcd0688307ac0ce19c4306f6b4.tar.gz rails-25f8a25c3ea107dcd0688307ac0ce19c4306f6b4.tar.bz2 rails-25f8a25c3ea107dcd0688307ac0ce19c4306f6b4.zip |
Added next_week and made beginning_of_week be a Monday, not a Sunday
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/time_ext_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index 1918b01b23..a948d21e17 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -12,7 +12,7 @@ class TimeExtCalculationsTest < Test::Unit::TestCase end def test_begining_of_week - assert_equal Time.local(2005,1,30), Time.local(2005,2,4,10,10,10).beginning_of_week + assert_equal Time.local(2005,1,31), Time.local(2005,2,4,10,10,10).beginning_of_week end def test_beginning_of_day @@ -80,4 +80,10 @@ class TimeExtCalculationsTest < Test::Unit::TestCase assert_equal Time.utc(2005,2,22,16,45), Time.utc(2005,2,22,15,15,10).change(:hour => 16, :min => 45) assert_equal Time.utc(2005,2,22,15,45), Time.utc(2005,2,22,15,15,10).change(:min => 45) 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) + end end
\ No newline at end of file |