[ruby/rubygems] We don't need to allow some warning because:

Always build gems with RubyGems programmatically

https://github.com/ruby/rubygems/commit/5cc0c34e64
This commit is contained in:
David Rodríguez 2025-06-23 13:26:52 +02:00 committed by git
parent 3c68b781dc
commit 253485484c
2 changed files with 2 additions and 16 deletions

View File

@ -118,7 +118,7 @@ RSpec.describe "bundle install with gem sources" do
it "does not state that it's constantly reinstalling empty gems" do
build_repo4 do
build_gem "empty", "1.0.0", no_default: true, allowed_warning: "no files specified"
build_gem "empty", "1.0.0", no_default: true
end
install_gemfile <<~G

View File

@ -192,13 +192,7 @@ module Spec
# command is expired too. So give `gem install` commands a bit more time.
options[:timeout] = 120
allowed_warning = options.delete(:allowed_warning)
output = sys_exec("#{Path.gem_bin} #{command}", options)
stderr = last_command.stderr
raise stderr if stderr.include?("WARNING") && !allowed_rubygems_warning?(stderr, allowed_warning)
output
sys_exec("#{Path.gem_bin} #{command}", options)
end
def sys_exec(cmd, options = {}, &block)
@ -537,14 +531,6 @@ module Spec
private
def allowed_rubygems_warning?(text, extra_allowed_warning)
allowed_warnings = ["open-ended", "is a symlink", "rake based", "expected RubyGems version"]
allowed_warnings << extra_allowed_warning if extra_allowed_warning
allowed_warnings.any? do |warning|
text.include?(warning)
end
end
def match_source(contents)
match = /source ["']?(?<source>http[^"']+)["']?/.match(contents)
return unless match