1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Added the condition for ruby_core repository.

This commit is contained in:
Hiroshi SHIBATA 2019-06-09 11:00:07 +09:00
parent 57ccea6232
commit 44f7f093ab
2 changed files with 15 additions and 2 deletions

View file

@ -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

View file

@ -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)