From 3ba066e54f9bfae053ca4baac90a4f745166a507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 5 Jun 2025 11:57:18 +0200 Subject: [rubygems/rubygems] Improve more exec specs to avoid swallowing errors https://github.com/rubygems/rubygems/commit/439e9bcf81 --- spec/bundler/commands/exec_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb index ec8f4c5b89..aa504ea2a7 100644 --- a/spec/bundler/commands/exec_spec.rb +++ b/spec/bundler/commands/exec_spec.rb @@ -1200,11 +1200,11 @@ RSpec.describe "bundle exec" do context "with a system gem that shadows a default gem" do let(:openssl_version) { "99.9.9" } - let(:expected) { ruby "gem 'openssl', '< 999999'; require 'openssl'; puts OpenSSL::VERSION", artifice: nil, raise_on_error: false } it "only leaves the default gem in the stdlib available" do + default_openssl_version = ruby "require 'openssl'; puts OpenSSL::VERSION" + skip "https://github.com/rubygems/rubygems/issues/3351" if Gem.win_platform? - skip "openssl isn't a default gem" if expected.empty? install_gemfile "source \"https://gem.repo1\"" # must happen before installing the broken system gem @@ -1229,10 +1229,10 @@ RSpec.describe "bundle exec" do env = { "PATH" => path } aggregate_failures do - expect(bundle("exec #{file}", artifice: nil, env: env)).to eq(expected) - expect(bundle("exec bundle exec #{file}", artifice: nil, env: env)).to eq(expected) - expect(bundle("exec ruby #{file}", artifice: nil, env: env)).to eq(expected) - expect(run(file.read, artifice: nil, env: env)).to eq(expected) + expect(bundle("exec #{file}", artifice: nil, env: env)).to eq(default_openssl_version) + expect(bundle("exec bundle exec #{file}", artifice: nil, env: env)).to eq(default_openssl_version) + expect(bundle("exec ruby #{file}", artifice: nil, env: env)).to eq(default_openssl_version) + expect(run(file.read, artifice: nil, env: env)).to eq(default_openssl_version) end skip "ruby_core has openssl and rubygems in the same folder, and this test needs rubygems require but default openssl not in a directly added entry in $LOAD_PATH" if ruby_core? -- cgit v1.2.3