summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-05 18:43:47 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-06 17:01:43 +0200
commit764d8e8fd177b97005e52d9cd3f0731967b66745 (patch)
tree74151f10947cfa019a201bb74dfef16374afbfa8
parentc189dfdde0fabe93559a263734a0e953dcead105 (diff)
downloadbundler-improve_load_path_order_spec.tar.gz
Make spec pass more resilientlyimprove_load_path_order_spec
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.
-rw-r--r--spec/runtime/setup_spec.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index bee4e3fdd1..866f4862c5 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/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",