From 67e18160e6cd53b2cc605eaeaeae2a0557246e7c Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 9 Jan 2020 04:01:14 +0900 Subject: [PATCH] Fix deprecation warnings in Active Support tests --- activesupport/test/core_ext/range_ext_test.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/activesupport/test/core_ext/range_ext_test.rb b/activesupport/test/core_ext/range_ext_test.rb index bae96dfa92..4d2a302e6b 100644 --- a/activesupport/test/core_ext/range_ext_test.rb +++ b/activesupport/test/core_ext/range_ext_test.rb @@ -197,11 +197,6 @@ def test_cover_on_time_with_zone end def test_include_on_time_with_zone - twz = ActiveSupport::TimeWithZone.new(nil, ActiveSupport::TimeZone["Eastern Time (US & Canada)"], Time.utc(2006, 11, 28, 10, 30)) - assert ((twz - 1.hour)..twz).include?(twz) - end - - def test_include_on_time_with_zone_deprecation twz = ActiveSupport::TimeWithZone.new(nil, ActiveSupport::TimeZone["Eastern Time (US & Canada)"], Time.utc(2006, 11, 28, 10, 30)) assert_deprecated do ((twz - 1.hour)..twz).include?(twz) @@ -210,7 +205,13 @@ def test_include_on_time_with_zone_deprecation def test_case_equals_on_time_with_zone twz = ActiveSupport::TimeWithZone.new(nil, ActiveSupport::TimeZone["Eastern Time (US & Canada)"], Time.utc(2006, 11, 28, 10, 30)) - assert ((twz - 1.hour)..twz) === twz + if RUBY_VERSION >= "2.6" # https://bugs.ruby-lang.org/issues/14575 + assert ((twz - 1.hour)..twz) === twz + else + assert_deprecated do + assert ((twz - 1.hour)..twz) === twz + end + end end def test_date_time_with_each -- GitLab