diff options
author | Glenn Pratt <glennpratt@gmail.com> | 2016-02-01 12:50:08 -0600 |
---|---|---|
committer | Glenn Pratt <glennpratt@gmail.com> | 2016-02-03 22:44:37 -0600 |
commit | 1571c520c7223d4eef7ac9a167683ad60048ae6f (patch) | |
tree | b15a20056bafc2f3ffc7db003f0f51aa273e2b4c /spec/install | |
parent | f9a3a5148e7902ae4e30e837060806067e9025f5 (diff) | |
download | bundler-1571c520c7223d4eef7ac9a167683ad60048ae6f.tar.gz |
Make standalone bin load path relative to Bundler.root rather than CWD.
Fixes #4144
Diffstat (limited to 'spec/install')
-rw-r--r-- | spec/install/gems/standalone_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/install/gems/standalone_spec.rb b/spec/install/gems/standalone_spec.rb index 4ce5d92e..d0f5af70 100644 --- a/spec/install/gems/standalone_spec.rb +++ b/spec/install/gems/standalone_spec.rb @@ -272,5 +272,35 @@ describe "bundle install --standalone" do expect(`#{bundled_app}/bin/rails -v`.chomp).to eql "2.3.2" end end + + it "creates stubs with the correct load path" do + extension_line = File.read(bundled_app("bin/rails")).each_line.find {|line| line.include? "$:.unshift" }.strip + expect(extension_line).to eq "$:.unshift File.expand_path '../../bundle', __FILE__" + end + end + + describe "with --binstubs run in a subdirectory" do + before do + FileUtils.mkdir_p("bob") + Dir.chdir("bob") do + install_gemfile <<-G, :standalone => true, :binstubs => true + source "file://#{gem_repo1}" + gem "rails" + G + end + end + + # @todo This test fails because the bundler/setup.rb is written to the + # current directory. + xit "creates stubs that use the standalone load path" do + Dir.chdir(bundled_app) do + expect(`bin/rails -v`.chomp).to eql "2.3.2" + end + end + + it "creates stubs with the correct load path" do + extension_line = File.read(bundled_app("bin/rails")).each_line.find {|line| line.include? "$:.unshift" }.strip + expect(extension_line).to eq "$:.unshift File.expand_path '../../bundle', __FILE__" + end end end |