aboutsummaryrefslogtreecommitdiffstats
path: root/spec/runtime
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-04-29 09:44:58 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-04-29 21:14:40 -0500
commitaeb55f18df64ef49ac6ae2fa69eecd893ca446a3 (patch)
tree71520a3c3dd2aacb6c24bffd96cfd48b4fc30391 /spec/runtime
parentebbdce0f9c38e7eacb00325d910a290628566fe7 (diff)
downloadbundler-aeb55f18df64ef49ac6ae2fa69eecd893ca446a3.tar.gz
[Runtime] Fix the ordering of the load path when there are dependencies
It was previously getting reversed
Diffstat (limited to 'spec/runtime')
-rw-r--r--spec/runtime/setup_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index 1b2b442f..24d0b69c 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -133,6 +133,37 @@ describe "Bundler.setup" do
expect(load_path[2]).to include "rubylib_dir"
expect(rack_load_order).to be > 0
end
+
+ it "orders the load path correctly when there are dependencies" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rails"
+ G
+
+ ruby <<-RUBY
+ require 'rubygems'
+ require 'bundler'
+ Bundler.setup
+ puts $LOAD_PATH
+ RUBY
+
+ load_path = out.split("\n") - [
+ bundler_path.to_s,
+ bundler_path.join("gems/bundler-#{Bundler::VERSION}/lib").to_s,
+ tmp("rubygems/lib").to_s,
+ ]
+ load_path.map! {|lp| lp.sub(/^#{system_gem_path}/, "") }
+
+ expect(load_path).to start_with(
+ "/gems/rails-2.3.2/lib",
+ "/gems/activeresource-2.3.2/lib",
+ "/gems/activerecord-2.3.2/lib",
+ "/gems/actionpack-2.3.2/lib",
+ "/gems/actionmailer-2.3.2/lib",
+ "/gems/activesupport-2.3.2/lib",
+ "/gems/rake-10.0.2/lib",
+ )
+ end
end
it "raises if the Gemfile was not yet installed" do