diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-26 13:07:22 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-26 13:07:22 +0000 |
commit | fabf34848eda7656f7a7f79647167e0fdd16f682 (patch) | |
tree | 6736de2f1a4d68bfe386e99ce4ebeca1109e9e6f /activesupport/test | |
parent | a8eea0b04b2989bd054d7c852d636f1cc5494957 (diff) | |
download | rails-fabf34848eda7656f7a7f79647167e0fdd16f682.tar.gz rails-fabf34848eda7656f7a7f79647167e0fdd16f682.tar.bz2 rails-fabf34848eda7656f7a7f79647167e0fdd16f682.zip |
Added Time#end_of_month to accompany Time#beginning_of_month (closes #2514) [Jens-Christian Fischer]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2745 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/time_ext_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index 0119c92c93..5dce75b6f4 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -30,6 +30,13 @@ class TimeExtCalculationsTest < Test::Unit::TestCase assert_equal Time.local(2005,2,1,0,0,0), Time.local(2005,2,22,10,10,10).beginning_of_month end + def test_end_of_month + assert_equal Time.local(2005,3,31,0,0,0), Time.local(2005,3,20,10,10,10).end_of_month + assert_equal Time.local(2005,2,28,0,0,0), Time.local(2005,2,20,10,10,10).end_of_month + assert_equal Time.local(2005,4,30,0,0,0), Time.local(2005,4,20,10,10,10).end_of_month + + end + def test_beginning_of_year assert_equal Time.local(2005,1,1,0,0,0), Time.local(2005,2,22,10,10,10).beginning_of_year end |