diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/core_ext/date_ext_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/date_ext_test.rb b/activesupport/test/core_ext/date_ext_test.rb index 1f94b80edc..d5f3eed8c1 100644 --- a/activesupport/test/core_ext/date_ext_test.rb +++ b/activesupport/test/core_ext/date_ext_test.rb @@ -141,10 +141,18 @@ class DateExtCalculationsTest < Test::Unit::TestCase assert_equal Date.new(2004,6,5), Date.new(2005,6,5).last_year end + def test_last_year_in_leap_years + assert_equal Date.new(1999,2,28), Date.new(2000,2,29).last_year + end + def test_next_year assert_equal Date.new(2006,6,5), Date.new(2005,6,5).next_year end + def test_next_year_in_leap_years + assert_equal Date.new(2001,2,28), Date.new(2000,2,29).next_year + end + def test_yesterday assert_equal Date.new(2005,2,21), Date.new(2005,2,22).yesterday assert_equal Date.new(2005,2,28), Date.new(2005,3,2).yesterday.yesterday |