aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_ext_test.rb
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-08-31 10:47:05 +0000
committerJamis Buck <jamis@37signals.com>2005-08-31 10:47:05 +0000
commit2fed808ee4d572da5d86cb91c704e569589bd7cc (patch)
treeffe742ef68a0164976f64902cc955b4723565514 /activesupport/test/core_ext/time_ext_test.rb
parent70e96c9f5c1bfcbb056c34fe7afe3d39226d1cc6 (diff)
downloadrails-2fed808ee4d572da5d86cb91c704e569589bd7cc.tar.gz
rails-2fed808ee4d572da5d86cb91c704e569589bd7cc.tar.bz2
rails-2fed808ee4d572da5d86cb91c704e569589bd7cc.zip
Make Time#last_month work when invoked on the 31st of a month.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2083 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.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb
index ca58cd0a8a..60649e4c76 100644
--- a/activesupport/test/core_ext/time_ext_test.rb
+++ b/activesupport/test/core_ext/time_ext_test.rb
@@ -161,4 +161,8 @@ class TimeExtCalculationsTest < Test::Unit::TestCase
def test_next_month_on_31st
assert_equal Time.local(2005, 9, 30), Time.local(2005, 8, 31).next_month
end
+
+ def test_last_month_on_31st
+ assert_equal Time.local(2004, 2, 29), Time.local(2004, 3, 31).last_month
+ end
end