summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2024-09-20 14:24:06 +0200
committergit <svn-admin@ruby-lang.org>2024-09-20 15:57:42 +0000
commit54a21851fef85563940dffbb2fe19e1da69d44bf (patch)
treed644869eac988bcf5a0d359671aec14d77a9f61b
parent8dd87a66f58dcc35fea871c9b120e230043e9051 (diff)
[rubygems/rubygems] Disallow RubyGems warnings during Bundler test suite
https://github.com/rubygems/rubygems/commit/472371ee1e
-rw-r--r--spec/bundler/support/helpers.rb9
1 files changed, 8 insertions, 1 deletions
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 ["']?(?<source>http[^"']+)["']?/.match(contents)
return unless match