From 2fed808ee4d572da5d86cb91c704e569589bd7cc Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Wed, 31 Aug 2005 10:47:05 +0000 Subject: 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 --- activesupport/test/core_ext/time_ext_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/test/core_ext') 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 -- cgit v1.2.3