diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-06-09 11:00:07 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-06-09 12:44:27 +0900 |
commit | 44f7f093ab8d8663cbbe31d8a975ae6e8d20724f (patch) | |
tree | a51392847435da60f7c5c31c79accfc18996cb5e /spec | |
parent | 57ccea6232a76aec5711e5e583cffe0aa5221928 (diff) | |
download | ruby-44f7f093ab8d8663cbbe31d8a975ae6e8d20724f.tar.gz |
Added the condition for ruby_core repository.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/bundler/shared_helpers_spec.rb | 10 | ||||
-rw-r--r-- | spec/bundler/commands/exec_spec.rb | 7 |
2 files changed, 15 insertions, 2 deletions
diff --git a/spec/bundler/bundler/shared_helpers_spec.rb b/spec/bundler/bundler/shared_helpers_spec.rb index 8e82d1b910..a040c291d9 100644 --- a/spec/bundler/bundler/shared_helpers_spec.rb +++ b/spec/bundler/bundler/shared_helpers_spec.rb @@ -223,6 +223,14 @@ RSpec.describe Bundler::SharedHelpers do ENV["BUNDLE_GEMFILE"] = "Gemfile" end + let(:setup_path) do + if ruby_core? + File.expand_path("../../../lib/bundler/setup", __dir__) + else + File.expand_path("../../lib/bundler/setup", __dir__) + end + end + shared_examples_for "ENV['PATH'] gets set correctly" do before { Dir.mkdir ".bundle" } @@ -236,7 +244,7 @@ RSpec.describe Bundler::SharedHelpers do shared_examples_for "ENV['RUBYOPT'] gets set correctly" do it "ensures -rbundler/setup is at the beginning of ENV['RUBYOPT']" do subject.set_bundle_environment - expect(ENV["RUBYOPT"].split(" ")).to start_with("-r#{File.expand_path("../../lib/bundler/setup", __dir__)}") + expect(ENV["RUBYOPT"].split(" ")).to start_with("-r#{setup_path}") end end diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb index 8f49c576b5..fe5cb9f50c 100644 --- a/spec/bundler/commands/exec_spec.rb +++ b/spec/bundler/commands/exec_spec.rb @@ -279,7 +279,12 @@ RSpec.describe "bundle exec" do G rubyopt = ENV["RUBYOPT"] - rubyopt = "-r#{File.expand_path("../../lib/bundler/setup", __dir__)} #{rubyopt}" + setup_path = if ruby_core? + File.expand_path("../../../lib/bundler/setup", __dir__) + else + File.expand_path("../../lib/bundler/setup", __dir__) + end + rubyopt = "-r#{setup_path} #{rubyopt}" bundle "exec 'echo $RUBYOPT'" expect(out).to have_rubyopts(rubyopt) |