From 41534ce327efb56f3ddb136b5617fe47a89212b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 5 Aug 2019 18:43:47 +0200 Subject: [bundler/bundler] Make spec pass more resiliently Previously, if bundler-2.1.0.pre.1 would be installed globally, it would fail. Now we force that a locally installed version of bundler is used, so it always passed regardless of which bundler is installed globally. https://github.com/bundler/bundler/commit/764d8e8fd1 --- spec/bundler/runtime/setup_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'spec/bundler/runtime') diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb index bee4e3fdd1..866f4862c5 100644 --- a/spec/bundler/runtime/setup_spec.rb +++ b/spec/bundler/runtime/setup_spec.rb @@ -114,7 +114,7 @@ RSpec.describe "Bundler.setup" do def clean_load_path(lp) without_bundler_load_path = ruby!("puts $LOAD_PATH").split("\n") lp -= without_bundler_load_path - lp.map! {|p| p.sub(/^#{Regexp.union system_gem_path.to_s, default_bundle_path.to_s}/i, "") } + lp.map! {|p| p.sub(/^#{Regexp.union system_gem_path.to_s, default_bundle_path.to_s, bundler_path.to_s}/i, "") } end it "puts loaded gems after -I and RUBYLIB", :ruby_repo do @@ -142,6 +142,8 @@ RSpec.describe "Bundler.setup" do end it "orders the load path correctly when there are dependencies" do + system_gems :bundler + install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "rails" @@ -158,6 +160,7 @@ RSpec.describe "Bundler.setup" do expect(load_path).to start_with( "/gems/rails-2.3.2/lib", + "/gems/bundler-#{Bundler::VERSION}/lib", "/gems/activeresource-2.3.2/lib", "/gems/activerecord-2.3.2/lib", "/gems/actionpack-2.3.2/lib", -- cgit v1.2.3