summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-06-17 13:17:54 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-03 09:29:56 +0900
commit4089f8df1e985ec9b5347078214646be946229cc (patch)
tree4d8fd2056ef04acce2618328a094662b5e0b0917 /spec
parente59b57a3a7d7d22baf80754e1ec069cc8cd4d561 (diff)
[bundler/bundler] Use real paths for `bundle clean`
https://github.com/bundler/bundler/commit/0646f9e286
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/clean_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/bundler/commands/clean_spec.rb b/spec/bundler/commands/clean_spec.rb
index 69a5d1e6b0..17a533ef19 100644
--- a/spec/bundler/commands/clean_spec.rb
+++ b/spec/bundler/commands/clean_spec.rb
@@ -183,6 +183,32 @@ RSpec.describe "bundle clean" do
expect(vendored_gems("bin/rackup")).to exist
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
build_git "foo-bar", :path => lib_path("foo-bar")
revision = revision_for(lib_path("foo-bar"))