aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2019-03-19 11:37:19 +0000
committerGitHub <noreply@github.com>2019-03-19 11:37:19 +0000
commit4a797074e40916d85012461a92310b46d396428a (patch)
tree80ad40dcde6fafb24c0e0f02a7120bcdb384b5a7 /activesupport/test
parent6e94127dd21271f3fcebc865c23974a75de20f3c (diff)
parent58ac3f212f0dca31d8dc3c35ba13c14581d8b5f3 (diff)
downloadrails-4a797074e40916d85012461a92310b46d396428a.tar.gz
rails-4a797074e40916d85012461a92310b46d396428a.tar.bz2
rails-4a797074e40916d85012461a92310b46d396428a.zip
Merge pull request #35659 from rails/fix-time-advance-with-historical-dates
Fix Time#advance to work with dates before 1001-03-07
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/time_ext_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb
index 7078f3506d..590b81b770 100644
--- a/activesupport/test/core_ext/time_ext_test.rb
+++ b/activesupport/test/core_ext/time_ext_test.rb
@@ -514,6 +514,8 @@ class TimeExtCalculationsTest < ActiveSupport::TestCase
assert_equal Time.local(1582, 10, 15, 15, 15, 10), Time.local(1582, 10, 14, 15, 15, 10).advance(days: 1)
assert_equal Time.local(1582, 10, 5, 15, 15, 10), Time.local(1582, 10, 4, 15, 15, 10).advance(days: 1)
assert_equal Time.local(1582, 10, 4, 15, 15, 10), Time.local(1582, 10, 5, 15, 15, 10).advance(days: -1)
+ assert_equal Time.local(999, 10, 4, 15, 15, 10), Time.local(1000, 10, 4, 15, 15, 10).advance(years: -1)
+ assert_equal Time.local(1000, 10, 4, 15, 15, 10), Time.local(999, 10, 4, 15, 15, 10).advance(years: 1)
end
def test_last_week