summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2025-06-05 11:57:18 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2025-06-06 10:09:14 +0900
commit3ba066e54f9bfae053ca4baac90a4f745166a507 (patch)
tree93bc3f970be10fca9a1d0e6b8dacc4ca70c75840
parent3b2d068ac2250fae91bd4b433b8ce393615ddc86 (diff)
[rubygems/rubygems] Improve more exec specs to avoid swallowing errors
https://github.com/rubygems/rubygems/commit/439e9bcf81
-rw-r--r--spec/bundler/commands/exec_spec.rb12
1 files 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?