зеркало из https://github.com/github/ruby.git
Update to ruby/mspec@b56e7a2
This commit is contained in:
Родитель
1388257d7a
Коммит
342fbae83c
|
@ -36,6 +36,7 @@ class LeakChecker
|
|||
@thread_info = find_threads
|
||||
@env_info = find_env
|
||||
@argv_info = find_argv
|
||||
@globals_info = find_globals
|
||||
@encoding_info = find_encodings
|
||||
end
|
||||
|
||||
|
@ -48,9 +49,10 @@ class LeakChecker
|
|||
check_process_leak
|
||||
check_env
|
||||
check_argv
|
||||
check_globals
|
||||
check_encodings
|
||||
check_tracepoints
|
||||
GC.start if !@leaks.empty?
|
||||
GC.start unless @leaks.empty?
|
||||
@leaks.empty?
|
||||
end
|
||||
|
||||
|
@ -244,6 +246,19 @@ class LeakChecker
|
|||
end
|
||||
end
|
||||
|
||||
def find_globals
|
||||
{ verbose: $VERBOSE, debug: $DEBUG }
|
||||
end
|
||||
|
||||
def check_globals
|
||||
old_globals = @globals_info
|
||||
new_globals = find_globals
|
||||
if new_globals != old_globals
|
||||
leak "Globals changed: #{old_globals.inspect} to #{new_globals.inspect}"
|
||||
@globals_info = new_globals
|
||||
end
|
||||
end
|
||||
|
||||
def find_encodings
|
||||
[Encoding.default_internal, Encoding.default_external]
|
||||
end
|
||||
|
|
|
@ -45,7 +45,6 @@ if Object.const_defined?(:Warning) and Warning.respond_to?(:warn)
|
|||
when /\/(argf|io|stringio)\/.+(ARGF|IO)#(lines|chars|bytes|codepoints) is deprecated/
|
||||
when /Thread\.exclusive is deprecated.+\n.+thread\/exclusive_spec\.rb/
|
||||
when /hash\/shared\/index\.rb:\d+: warning: Hash#index is deprecated; use Hash#key/
|
||||
when /env\/shared\/key\.rb:\d+: warning: ENV\.index is deprecated; use ENV\.key/
|
||||
when /exponent(_spec)?\.rb:\d+: warning: in a\*\*b, b may be too big/
|
||||
when /enumerator\/(new_spec|initialize_spec)\.rb:\d+: warning: Enumerator\.new without a block is deprecated/
|
||||
when /Pattern matching is experimental, and the behavior may change in future versions of Ruby!/
|
||||
|
|
Загрузка…
Ссылка в новой задаче