Enable deprecation warnings for test-all
* So deprecated methods/constants/functions are dealt with early, instead of many tests breaking suddenly when removing a deprecated method/constant/function. * Follows https://bugs.ruby-lang.org/issues/17591
This commit is contained in:
parent
5e39b3b844
commit
92b907d12d
Notes:
git
2022-09-10 20:14:40 +09:00
@ -1053,7 +1053,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
|
|||||||
warning << [str, category]
|
warning << [str, category]
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
define_method(:warn) do |str|
|
define_method(:warn) do |str, category: nil|
|
||||||
warning << str
|
warning << str
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,5 +1,20 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# Enable deprecation warnings for test-all, so deprecated methods/constants/functions are dealt with early.
|
||||||
|
Warning[:deprecated] = true
|
||||||
|
|
||||||
|
if ENV['BACKTRACE_FOR_DEPRECATION_WARNINGS']
|
||||||
|
Warning.extend Module.new {
|
||||||
|
def warn(message, category: nil, **kwargs)
|
||||||
|
if category == :deprecated and $stderr.respond_to?(:puts)
|
||||||
|
$stderr.puts nil, message, caller, nil
|
||||||
|
else
|
||||||
|
super
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
require_relative '../envutil'
|
require_relative '../envutil'
|
||||||
require_relative '../colorize'
|
require_relative '../colorize'
|
||||||
require_relative '../leakchecker'
|
require_relative '../leakchecker'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user