diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-07-27 19:43:01 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-08-31 19:06:14 +0900 |
commit | f1c072912813f9fc226e819f9c3a770869d005c7 (patch) | |
tree | 38669ef232ecb3b69f85215afcba2825ac21ff2a /spec/bundler | |
parent | 7465b94f8a4c2849498bf36b98be8da99c0504c2 (diff) | |
download | ruby-f1c072912813f9fc226e819f9c3a770869d005c7.tar.gz |
[rubygems/rubygems] Fix standalone generated script to deal with path sources
In the case of path sources, the path the source is pointing to should
be added directly to the `$LOAD_PATH` without any modifications.
https://github.com/rubygems/rubygems/commit/d3bba936f0
Co-authored-by: Daniel Niknam <mhmd.niknam@gmail.com>
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/install/gems/standalone_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/bundler/install/gems/standalone_spec.rb b/spec/bundler/install/gems/standalone_spec.rb index fc8e24f9f5..15ffc80e69 100644 --- a/spec/bundler/install/gems/standalone_spec.rb +++ b/spec/bundler/install/gems/standalone_spec.rb @@ -147,6 +147,36 @@ RSpec.shared_examples "bundle install --standalone" do end end + describe "with Gemfiles using path sources and resulting bundle moved to a folder hierarchy with different nesting" do + before do + build_lib "minitest", "1.0.0", :path => lib_path("minitest") + + Dir.mkdir bundled_app("app") + + gemfile bundled_app("app/Gemfile"), <<-G + source "#{file_uri_for(gem_repo1)}" + gem "minitest", :path => "#{lib_path("minitest")}" + G + + bundle "install", :standalone => true, :dir => bundled_app("app") + + Dir.mkdir tmp("one_more_level") + FileUtils.mv bundled_app, tmp("one_more_level") + end + + it "also works" do + ruby <<-RUBY, :dir => tmp("one_more_level/bundled_app/app") + require "./bundle/bundler/setup" + + require "minitest" + puts MINITEST + RUBY + + expect(out).to eq("1.0.0") + expect(err).to be_empty + end + end + describe "with gems with native extension", :ruby_repo do before do bundle "config set --local path #{bundled_app("bundle")}" |