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_time_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_time_ext_test.rb')
-rw-r--r-- | activesupport/test/core_ext/date_time_ext_test.rb | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/activesupport/test/core_ext/date_time_ext_test.rb b/activesupport/test/core_ext/date_time_ext_test.rb index a6124197ae..894fb80cba 100644 --- a/activesupport/test/core_ext/date_time_ext_test.rb +++ b/activesupport/test/core_ext/date_time_ext_test.rb @@ -285,18 +285,6 @@ class DateTimeExtCalculationsTest < ActiveSupport::TestCase end end - def test_before - assert_equal false, DateTime.civil(2017, 3, 6, 12, 0, 0).before?(DateTime.civil(2017, 3, 6, 11, 59, 59)) - assert_equal false, DateTime.civil(2017, 3, 6, 12, 0, 0).before?(DateTime.civil(2017, 3, 6, 12, 0, 0)) - assert_equal true, DateTime.civil(2017, 3, 6, 12, 0, 0).before?(DateTime.civil(2017, 3, 6, 12, 00, 1)) - end - - def test_after - assert_equal true, DateTime.civil(2017, 3, 6, 12, 0, 0).after?(DateTime.civil(2017, 3, 6, 11, 59, 59)) - assert_equal false, DateTime.civil(2017, 3, 6, 12, 0, 0).after?(DateTime.civil(2017, 3, 6, 12, 0, 0)) - assert_equal false, DateTime.civil(2017, 3, 6, 12, 0, 0).after?(DateTime.civil(2017, 3, 6, 12, 00, 1)) - end - def test_current_returns_date_today_when_zone_is_not_set with_env_tz "US/Eastern" do Time.stub(:now, Time.local(1999, 12, 31, 23, 59, 59)) do |