summaryrefslogtreecommitdiff
path: root/spec/bundler/support
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-06-11 21:05:17 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-06-15 12:38:39 +0900
commit117b504b98add70984313d96e9d4b67d74b10c8b (patch)
tree81c4011e36175f74345747cad5d953e260aebf71 /spec/bundler/support
parentf5f6415f264400e44888afb9335f76bd46e3f69d (diff)
Fix most exec specs
The `gem_command` helper was failing to require `support/hax.rb`, which takes care of making sure rubygems actually picks up the right `ruby` executable under ruby-core setup (`ENV["RUBY"]`). This caused binstubs to be generated with a wrong shebang, and that caused `bundle exec` to not work. The error message was pretty confusing though due to https://bugs.ruby-lang.org/issues/16952.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3225
Diffstat (limited to 'spec/bundler/support')
-rw-r--r--spec/bundler/support/helpers.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb
index fe786d4381..8151907da5 100644
--- a/spec/bundler/support/helpers.rb
+++ b/spec/bundler/support/helpers.rb
@@ -171,6 +171,9 @@ module Spec
end
def gem_command(command, options = {})
+ env = options[:env] || {}
+ env["RUBYOPT"] = opt_add("-r#{spec_dir}/support/hax.rb", env["RUBYOPT"] || ENV["RUBYOPT"])
+ options[:env] = env
sys_exec("#{Path.gem_bin} #{command}", options)
end
bang :gem_command