From 253485484c08aa56b1ea154b880eea217656d195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 23 Jun 2025 13:26:52 +0200 Subject: [ruby/rubygems] We don't need to allow some warning because: Always build gems with RubyGems programmatically https://github.com/ruby/rubygems/commit/5cc0c34e64 --- spec/bundler/commands/install_spec.rb | 2 +- spec/bundler/support/helpers.rb | 16 +--------------- 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'spec') diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 8506005746..c3d0f281a0 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -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 diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index 719a6e65d2..12ff09b714 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -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 ["']?(?http[^"']+)["']?/.match(contents) return unless match -- cgit v1.2.3