summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2025-07-23 19:16:00 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2025-07-25 11:10:34 +0900
commitb78406a032b747408bb466716ef02c195a327b85 (patch)
tree6be32efdd8df06e909162b18296329136e02c97a
parente673bbf77b8861bb294586d7c690d97c5093d472 (diff)
[rubygems/rubygems] Fix some specs running the wrong rake
https://github.com/rubygems/rubygems/commit/8d4eb154b1
-rw-r--r--spec/bundler/commands/newgem_spec.rb2
-rw-r--r--spec/bundler/runtime/gem_tasks_spec.rb13
-rw-r--r--spec/bundler/support/helpers.rb4
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"])