From 54a21851fef85563940dffbb2fe19e1da69d44bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Fri, 20 Sep 2024 14:24:06 +0200 Subject: [PATCH] [rubygems/rubygems] Disallow RubyGems warnings during Bundler test suite https://github.com/rubygems/rubygems/commit/472371ee1e --- spec/bundler/support/helpers.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index ef52e88eed..145008ab42 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -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 ["']?(?http[^"']+)["']?/.match(contents) return unless match