提交 67e18160 编写于 作者: R Ryuta Kamizono

Fix deprecation warnings in Active Support tests

上级 031763ab
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册