Skip to content

Commit 3ba066e

Browse files
deivid-rodriguezhsbt
authored andcommitted
[rubygems/rubygems] Improve more exec specs to avoid swallowing errors
ruby/rubygems@439e9bcf81
1 parent 3b2d068 commit 3ba066e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/bundler/commands/exec_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,11 +1200,11 @@ def require(path)
12001200

12011201
context "with a system gem that shadows a default gem" do
12021202
let(:openssl_version) { "99.9.9" }
1203-
let(:expected) { ruby "gem 'openssl', '< 999999'; require 'openssl'; puts OpenSSL::VERSION", artifice: nil, raise_on_error: false }
12041203

12051204
it "only leaves the default gem in the stdlib available" do
1205+
default_openssl_version = ruby "require 'openssl'; puts OpenSSL::VERSION"
1206+
12061207
skip "https://github.com/rubygems/rubygems/issues/3351" if Gem.win_platform?
1207-
skip "openssl isn't a default gem" if expected.empty?
12081208

12091209
install_gemfile "source \"https://gem.repo1\"" # must happen before installing the broken system gem
12101210

@@ -1229,10 +1229,10 @@ def require(path)
12291229

12301230
env = { "PATH" => path }
12311231
aggregate_failures do
1232-
expect(bundle("exec #{file}", artifice: nil, env: env)).to eq(expected)
1233-
expect(bundle("exec bundle exec #{file}", artifice: nil, env: env)).to eq(expected)
1234-
expect(bundle("exec ruby #{file}", artifice: nil, env: env)).to eq(expected)
1235-
expect(run(file.read, artifice: nil, env: env)).to eq(expected)
1232+
expect(bundle("exec #{file}", artifice: nil, env: env)).to eq(default_openssl_version)
1233+
expect(bundle("exec bundle exec #{file}", artifice: nil, env: env)).to eq(default_openssl_version)
1234+
expect(bundle("exec ruby #{file}", artifice: nil, env: env)).to eq(default_openssl_version)
1235+
expect(run(file.read, artifice: nil, env: env)).to eq(default_openssl_version)
12361236
end
12371237

12381238
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?

0 commit comments

Comments
 (0)