From f9103e1fe20e66315f4ea73e14df8850eec2f8e3 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 19 May 2005 17:36:25 +0000 Subject: Fixed Time#last_year to go back in time, not forward #1278 [fabien@odilat.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1319 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 6bad622386..18ae3219bc 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -56,6 +56,10 @@ class TimeExtCalculationsTest < Test::Unit::TestCase # Failure because of size limitations of numeric? # assert_equal Time.local(2182,6,5,10), Time.local(2005,6,5,10,0,0).years_since(177) end + + def test_last_year + assert_equal Time.local(2004,6,5,10), Time.local(2005,6,5,10,0,0).last_year + end def test_ago -- cgit v1.2.3