diff options
| author | Dylan Thacker-Smith <Dylan.Smith@shopify.com> | 2019-03-21 12:27:41 -0400 |
|---|---|---|
| committer | Dylan Thacker-Smith <Dylan.Smith@shopify.com> | 2019-03-21 12:27:51 -0400 |
| commit | a5d5feec2a170ede658df9323c15c0408aa754fb (patch) | |
| tree | 17ef24c59d3a95089098c804e76521f5a5fbae80 /spec/commands | |
| parent | b7de89fa8c1e39251051d26298a902c2630b2e2b (diff) | |
| download | bundler-a5d5feec2a170ede658df9323c15c0408aa754fb.tar.gz | |
Make `bundle clean` clean git extension directories
Diffstat (limited to 'spec/commands')
| -rw-r--r-- | spec/commands/clean_spec.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index 6cd796f694..96599a965b 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -770,4 +770,43 @@ RSpec.describe "bundle clean" do expect(very_simple_binary_extensions_dir).not_to exist expect(simple_binary_extensions_dir).to exist end + + it "removes git extension directories", :ruby_repo do + build_git "very_simple_git_binary", &:add_c_extension + + revision = revision_for(lib_path("very_simple_git_binary-1.0")) + short_revision = revision[0..11] + + gemfile <<-G + source "file://#{gem_repo1}" + + gem "thin" + gem "very_simple_git_binary", :git => "#{lib_path("very_simple_git_binary-1.0")}", :ref => "#{revision}" + G + + bundle! "install", forgotten_command_line_options(:path => "vendor/bundle") + + very_simple_binary_extensions_dir = + Pathname.glob("#{vendored_gems}/bundler/gems/extensions/*/*/very_simple_git_binary-1.0-#{short_revision}").first + + expect(very_simple_binary_extensions_dir).to exist + + gemfile <<-G + gem "very_simple_git_binary", :git => "#{lib_path("very_simple_git_binary-1.0")}", :ref => "#{revision}" + G + + bundle! "install" + bundle! :clean + expect(out).to include("Removing thin (1.0)") + expect(very_simple_binary_extensions_dir).to exist + + gemfile <<-G + G + + bundle! "install" + bundle! :clean + expect(out).to eq("Removing very_simple_git_binary-1.0 (#{short_revision})") + + expect(very_simple_binary_extensions_dir).not_to exist + end end |
