[rubygems/rubygems] Disallow RubyGems warnings during Bundler test suite

https://github.com/rubygems/rubygems/commit/472371ee1e
This commit is contained in:
David Rodríguez 2024-09-20 14:24:06 +02:00 committed by git
parent 8dd87a66f5
commit 54a21851fe

View File

@ -186,7 +186,10 @@ module Spec
env = options[:env] || {}
env["RUBYOPT"] = opt_add(opt_add("-r#{spec_dir}/support/hax.rb", env["RUBYOPT"]), ENV["RUBYOPT"])
options[:env] = env
sys_exec("#{Path.gem_bin} #{command}", options)
output = sys_exec("#{Path.gem_bin} #{command}", options)
stderr = last_command.stderr
raise stderr if stderr.include?("WARNING") && !allowed_rubygems_warning?(stderr)
output
end
def rake
@ -542,6 +545,10 @@ module Spec
private
def allowed_rubygems_warning?(text)
text.include?("open-ended") || text.include?("is a symlink") || text.include?("rake based") || text.include?("expected RubyGems version")
end
def match_source(contents)
match = /source ["']?(?<source>http[^"']+)["']?/.match(contents)
return unless match