Skip to content

Commit c115e3d

Browse files
deivid-rodriguezhsbt
authored andcommitted
[rubygems/rubygems] bundle exec does not need artifice in general
ruby/rubygems@cb1f19573a
1 parent 3546ced commit c115e3d

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

spec/bundler/commands/exec_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
end
205205

206206
it "uses version provided by ruby" do
207-
bundle "exec erb --version", artifice: nil
207+
bundle "exec erb --version"
208208

209209
expect(stdboth).to eq(default_erb_version)
210210
end
@@ -227,7 +227,7 @@
227227
end
228228

229229
it "uses version specified" do
230-
bundle "exec erb --version", artifice: nil
230+
bundle "exec erb --version"
231231

232232
expect(stdboth).to eq(specified_erb_version)
233233
end
@@ -254,7 +254,7 @@
254254
end
255255

256256
it "uses resolved version" do
257-
bundle "exec erb --version", artifice: nil
257+
bundle "exec erb --version"
258258

259259
expect(stdboth).to eq(indirect_erb_version)
260260
end
@@ -583,7 +583,7 @@
583583
G
584584

585585
bundle "config set auto_install 1"
586-
bundle "exec myrackup"
586+
bundle "exec myrackup", artifice: "compact_index"
587587
expect(out).to include("Installing foo 1.0")
588588
end
589589

@@ -598,7 +598,7 @@
598598
G
599599

600600
bundle "config set auto_install 1"
601-
bundle "exec foo"
601+
bundle "exec foo", artifice: "compact_index"
602602
expect(out).to include("Fetching myrack 0.9.1")
603603
expect(out).to include("Fetching #{lib_path("foo-1.0")}")
604604
expect(out.lines).to end_with("1.0")
@@ -625,7 +625,7 @@
625625
gem "fastlane"
626626
G
627627

628-
bundle "exec fastlane"
628+
bundle "exec fastlane", artifice: "compact_index"
629629
expect(out).to include("Installing optparse 999.999.999")
630630
expect(out).to include("2.192.0")
631631
end
@@ -1250,9 +1250,9 @@ def require(path)
12501250

12511251
env = { "PATH" => path }
12521252
aggregate_failures do
1253-
expect(bundle("exec #{file}", artifice: nil, env: env)).to eq(default_openssl_version)
1254-
expect(bundle("exec bundle exec #{file}", artifice: nil, env: env)).to eq(default_openssl_version)
1255-
expect(bundle("exec ruby #{file}", artifice: nil, env: env)).to eq(default_openssl_version)
1253+
expect(bundle("exec #{file}", env: env)).to eq(default_openssl_version)
1254+
expect(bundle("exec bundle exec #{file}", env: env)).to eq(default_openssl_version)
1255+
expect(bundle("exec ruby #{file}", env: env)).to eq(default_openssl_version)
12561256
expect(run(file.read, artifice: nil, env: env)).to eq(default_openssl_version)
12571257
end
12581258

spec/bundler/runtime/setup_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ def lock_with(ruby_version = nil)
14641464
install_gemfile "source 'https://gem.repo1'"
14651465
create_file("script.rb", "#!/usr/bin/env ruby\n\n#{code}")
14661466
FileUtils.chmod(0o777, bundled_app("script.rb"))
1467-
bundle "exec ./script.rb", artifice: nil, env: { "RUBYOPT" => activation_warning_hack_rubyopt }
1467+
bundle "exec ./script.rb", env: { "RUBYOPT" => activation_warning_hack_rubyopt }
14681468
expect(out).to eq("{}")
14691469
end
14701470

spec/bundler/support/helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def bundle(cmd, options = {}, &block)
8383
load_path << custom_load_path if custom_load_path
8484

8585
build_ruby_options = { load_path: load_path, requires: requires, env: env }
86-
build_ruby_options.merge!(artifice: options.delete(:artifice)) if options.key?(:artifice)
86+
build_ruby_options.merge!(artifice: options.delete(:artifice)) if options.key?(:artifice) || cmd.start_with?("exec")
8787

8888
match_source(cmd)
8989

0 commit comments

Comments
 (0)