From a7383fc7f478942d7d465152c1202da7125573dc Mon Sep 17 00:00:00 2001 From: sodacris Date: Wed, 4 Dec 2024 20:41:35 +0800 Subject: [rubygems/rubygems] Replace shell specific stuff with create_file scripts https://github.com/rubygems/rubygems/commit/eea07ad691 --- spec/bundler/commands/exec_spec.rb | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb index dc32d8bae8..0ab354198f 100644 --- a/spec/bundler/commands/exec_spec.rb +++ b/spec/bundler/commands/exec_spec.rb @@ -311,8 +311,7 @@ RSpec.describe "bundle exec" do end it "does not duplicate already exec'ed RUBYOPT" do - skip "https://github.com/rubygems/rubygems/issues/3351" if Gem.win_platform? - + create_file("echoopt", "#!/usr/bin/env ruby\nprint ENV['RUBYOPT']") install_gemfile <<-G source "https://gem.repo1" gem "myrack" @@ -322,16 +321,15 @@ RSpec.describe "bundle exec" do rubyopt = opt_add(bundler_setup_opt, ENV["RUBYOPT"]) - bundle "exec 'echo $RUBYOPT'" + bundle "exec echoopt" expect(out.split(" ").count(bundler_setup_opt)).to eq(1) - bundle "exec 'echo $RUBYOPT'", env: { "RUBYOPT" => rubyopt } + bundle "exec echoopt", env: { "RUBYOPT" => rubyopt } expect(out.split(" ").count(bundler_setup_opt)).to eq(1) end it "does not duplicate already exec'ed RUBYLIB" do - skip "https://github.com/rubygems/rubygems/issues/3351" if Gem.win_platform? - + create_file("echolib", "#!/usr/bin/env ruby\nprint ENV['RUBYLIB']") install_gemfile <<-G source "https://gem.repo1" gem "myrack" @@ -341,10 +339,10 @@ RSpec.describe "bundle exec" do rubylib = rubylib.to_s.split(File::PATH_SEPARATOR).unshift lib_dir.to_s rubylib = rubylib.uniq.join(File::PATH_SEPARATOR) - bundle "exec 'echo $RUBYLIB'" + bundle "exec echolib" expect(out).to include(rubylib) - bundle "exec 'echo $RUBYLIB'", env: { "RUBYLIB" => rubylib } + bundle "exec echolib", env: { "RUBYLIB" => rubylib } expect(out).to include(rubylib) end @@ -366,7 +364,7 @@ RSpec.describe "bundle exec" do gem "myrack" G - bundle "exec touch foo" + bundled_app("foo").write("") bundle "exec ./foo", raise_on_error: false expect(exitstatus).to eq(126) expect(err).to include("bundler: not executable: ./foo") @@ -453,7 +451,7 @@ RSpec.describe "bundle exec" do it "shows bundle-exec's man page when --help is between exec and the executable" do with_fake_man do - bundle "#{exec} --help cat" + bundle "#{exec} --help echo" end expect(out).to include(%(["#{man_dir}/bundle-exec.1"])) end -- cgit v1.2.3