[rubygems/rubygems] Extract logic to manipulate RUBYLIB in specs to a helper
https://github.com/rubygems/rubygems/commit/0057382bb1
This commit is contained in:
parent
3638f67069
commit
10e7e92bad
@ -258,8 +258,7 @@ RSpec.describe Bundler::SharedHelpers do
|
||||
|
||||
it "ensures bundler's ruby version lib path is in ENV['RUBYLIB']" do
|
||||
subject.set_bundle_environment
|
||||
paths = (ENV["RUBYLIB"]).split(File::PATH_SEPARATOR)
|
||||
expect(paths).to include(ruby_lib_path)
|
||||
expect(rubylib).to include(ruby_lib_path)
|
||||
end
|
||||
end
|
||||
|
||||
@ -276,8 +275,7 @@ RSpec.describe Bundler::SharedHelpers do
|
||||
|
||||
subject.set_bundle_environment
|
||||
|
||||
paths = (ENV["RUBYLIB"]).split(File::PATH_SEPARATOR)
|
||||
expect(paths.count(RbConfig::CONFIG["rubylibdir"])).to eq(0)
|
||||
expect(rubylib.count(RbConfig::CONFIG["rubylibdir"])).to eq(0)
|
||||
end
|
||||
|
||||
it "exits if bundle path contains the unix-like path separator" do
|
||||
@ -441,8 +439,7 @@ RSpec.describe Bundler::SharedHelpers do
|
||||
|
||||
it "ENV['RUBYLIB'] should only contain one instance of bundler's ruby version lib path" do
|
||||
subject.set_bundle_environment
|
||||
paths = (ENV["RUBYLIB"]).split(File::PATH_SEPARATOR)
|
||||
expect(paths.count(ruby_lib_path)).to eq(1)
|
||||
expect(rubylib.count(ruby_lib_path)).to eq(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -238,8 +238,7 @@ RSpec.describe "bundle install with gem sources" do
|
||||
it "loads env plugins" do
|
||||
plugin_msg = "hello from an env plugin!"
|
||||
create_file "plugins/rubygems_plugin.rb", "puts '#{plugin_msg}'"
|
||||
rubylib = ENV["RUBYLIB"].to_s.split(File::PATH_SEPARATOR).unshift(bundled_app("plugins").to_s).join(File::PATH_SEPARATOR)
|
||||
install_gemfile <<-G, env: { "RUBYLIB" => rubylib }
|
||||
install_gemfile <<-G, env: { "RUBYLIB" => rubylib.unshift(bundled_app("plugins").to_s).join(File::PATH_SEPARATOR) }
|
||||
source "https://gem.repo1"
|
||||
gem "myrack"
|
||||
G
|
||||
|
@ -5,5 +5,9 @@ module Spec
|
||||
def ruby_core?
|
||||
File.exist?(File.expand_path("../../../lib/bundler/bundler.gemspec", __dir__))
|
||||
end
|
||||
|
||||
def rubylib
|
||||
ENV["RUBYLIB"].to_s.split(File::PATH_SEPARATOR)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user