From b78406a032b747408bb466716ef02c195a327b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 23 Jul 2025 19:16:00 +0200 Subject: [rubygems/rubygems] Fix some specs running the wrong rake https://github.com/rubygems/rubygems/commit/8d4eb154b1 --- spec/bundler/commands/newgem_spec.rb | 2 +- spec/bundler/runtime/gem_tasks_spec.rb | 13 ++++--------- spec/bundler/support/helpers.rb | 4 ---- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index c1ab26ec10..5ce269d2ec 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/commands/newgem_spec.rb @@ -746,7 +746,7 @@ RSpec.describe "bundle gem" do file.puts rakefile end - sys_exec(rake, dir: bundled_app(gem_name)) + sys_exec("rake", dir: bundled_app(gem_name)) expect(out).to include("SUCCESS") end diff --git a/spec/bundler/runtime/gem_tasks_spec.rb b/spec/bundler/runtime/gem_tasks_spec.rb index 6a8de2b949..443971b056 100644 --- a/spec/bundler/runtime/gem_tasks_spec.rb +++ b/spec/bundler/runtime/gem_tasks_spec.rb @@ -66,9 +66,7 @@ RSpec.describe "require 'bundler/gem_tasks'" do it "includes the relevant tasks" do define_local_gem_using_gem_tasks - with_gem_path_as(scoped_base_system_gem_path.to_s) do - sys_exec "#{rake} -T", env: { "GEM_HOME" => system_gem_path.to_s } - end + sys_exec "rake -T" expect(err).to be_empty expected_tasks = [ @@ -85,9 +83,7 @@ RSpec.describe "require 'bundler/gem_tasks'" do it "defines a working `rake install` task", :ruby_repo do define_local_gem_using_gem_tasks - with_gem_path_as(scoped_base_system_gem_path.to_s) do - sys_exec "#{rake} install", env: { "GEM_HOME" => system_gem_path.to_s } - end + sys_exec "rake install" expect(err).to be_empty @@ -155,9 +151,8 @@ RSpec.describe "require 'bundler/gem_tasks'" do it "adds 'pkg' to rake/clean's CLOBBER" do define_local_gem_using_gem_tasks - with_gem_path_as(scoped_base_system_gem_path.to_s) do - sys_exec %(#{rake} -e 'load "Rakefile"; puts CLOBBER.inspect'), env: { "GEM_HOME" => system_gem_path.to_s } - end + sys_exec %(rake -e 'load "Rakefile"; puts CLOBBER.inspect') + expect(out).to eq '["pkg"]' end end diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index acf13c9733..2adabca742 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -196,10 +196,6 @@ module Spec output end - def rake - "#{Gem.ruby} -S #{ENV["GEM_PATH"]}/bin/rake" - end - def sys_exec(cmd, options = {}, &block) env = options[:env] || {} env["RUBYOPT"] = opt_add(opt_add("-r#{spec_dir}/support/switch_rubygems.rb", env["RUBYOPT"]), ENV["RUBYOPT"]) -- cgit v1.2.3