[bundler/bundler] Use real paths for bundle clean
https://github.com/bundler/bundler/commit/0646f9e286
This commit is contained in:
parent
e59b57a3a7
commit
4089f8df1e
@ -317,7 +317,7 @@ module Bundler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def spec_git_paths
|
def spec_git_paths
|
||||||
sources.git_sources.map {|s| s.path.to_s }
|
sources.git_sources.map {|s| File.realpath(s.path) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def groups
|
def groups
|
||||||
|
@ -183,6 +183,32 @@ RSpec.describe "bundle clean" do
|
|||||||
expect(vendored_gems("bin/rackup")).to exist
|
expect(vendored_gems("bin/rackup")).to exist
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "keeps used git gems even if installed to a symlinked location" do
|
||||||
|
build_git "foo", :path => lib_path("foo")
|
||||||
|
git_path = lib_path("foo")
|
||||||
|
revision = revision_for(git_path)
|
||||||
|
|
||||||
|
gemfile <<-G
|
||||||
|
source "file://#{gem_repo1}"
|
||||||
|
|
||||||
|
gem "rack", "1.0.0"
|
||||||
|
git "#{git_path}", :ref => "#{revision}" do
|
||||||
|
gem "foo"
|
||||||
|
end
|
||||||
|
G
|
||||||
|
|
||||||
|
FileUtils.mkdir_p(bundled_app("real-path"))
|
||||||
|
FileUtils.ln_sf(bundled_app("real-path"), bundled_app("symlink-path"))
|
||||||
|
|
||||||
|
bundle "install", forgotten_command_line_options(:path => bundled_app("symlink-path"))
|
||||||
|
|
||||||
|
bundle :clean
|
||||||
|
|
||||||
|
expect(out).not_to include("Removing foo (#{revision[0..11]})")
|
||||||
|
|
||||||
|
expect(bundled_app("symlink-path/#{Bundler.ruby_scope}/bundler/gems/foo-#{revision[0..11]}")).to exist
|
||||||
|
end
|
||||||
|
|
||||||
it "removes old git gems" do
|
it "removes old git gems" do
|
||||||
build_git "foo-bar", :path => lib_path("foo-bar")
|
build_git "foo-bar", :path => lib_path("foo-bar")
|
||||||
revision = revision_for(lib_path("foo-bar"))
|
revision = revision_for(lib_path("foo-bar"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user