diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-03-31 18:16:32 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-03-31 18:20:46 +0300 |
commit | 4e68b159d5696ca58c015a790ef3ceacb90b27c1 (patch) | |
tree | b08452ca48f359ed55c9e56b0f294966c8134b3a /activesupport/test/core_ext/date_ext_test.rb | |
parent | b1a0ab179f23888eaadacd8292cbcec49ab06fdf (diff) | |
download | rails-4e68b159d5696ca58c015a790ef3ceacb90b27c1.tar.gz rails-4e68b159d5696ca58c015a790ef3ceacb90b27c1.tar.bz2 rails-4e68b159d5696ca58c015a790ef3ceacb90b27c1.zip |
Move implementation of `before?` and `after?` to `DateAndTime::Calculations`
This prevents duplication of code.
Prevent duplication of tests by moving them to `DateAndTimeBehavior`.
Related to #32185.
Diffstat (limited to 'activesupport/test/core_ext/date_ext_test.rb')
-rw-r--r-- | activesupport/test/core_ext/date_ext_test.rb | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/activesupport/test/core_ext/date_ext_test.rb b/activesupport/test/core_ext/date_ext_test.rb index 8d3d575e0f..b8652884ce 100644 --- a/activesupport/test/core_ext/date_ext_test.rb +++ b/activesupport/test/core_ext/date_ext_test.rb @@ -360,18 +360,6 @@ class DateExtCalculationsTest < ActiveSupport::TestCase end end - def test_before - assert_equal false, Date.new(2017, 3, 6).before?(Date.new(2017, 3, 5)) - assert_equal false, Date.new(2017, 3, 6).before?(Date.new(2017, 3, 6)) - assert_equal true, Date.new(2017, 3, 6).before?(Date.new(2017, 3, 7)) - end - - def test_after - assert_equal true, Date.new(2017, 3, 6).after?(Date.new(2017, 3, 5)) - assert_equal false, Date.new(2017, 3, 6).after?(Date.new(2017, 3, 6)) - assert_equal false, Date.new(2017, 3, 6).after?(Date.new(2017, 3, 7)) - end - def test_current_returns_date_today_when_zone_not_set with_env_tz "US/Central" do Time.stub(:now, Time.local(1999, 12, 31, 23)) do |