diff options
author | Homu <homu@barosl.com> | 2016-10-15 05:06:48 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2016-10-15 05:06:48 +0900 |
commit | 37ec6051f6442a23b2c524cfdee02a13873a2a61 (patch) | |
tree | aba2e1425d4b27cc0c99729a655e6300ff1e3d1b /spec | |
parent | 509d50b17e0b77680ec5bdd4737c5ed73f87bd06 (diff) | |
parent | fca76d30dec6c1d3c0cc5459333901240c81deb4 (diff) | |
download | bundler-37ec6051f6442a23b2c524cfdee02a13873a2a61.tar.gz |
Auto merge of #5053 - hmistry:fix-clean-dry-run, r=segiddins
Changed the behavior of 'bundle clean --dry-run' to output the list regardless of path set or force option
Changed the behavior of 'bundle clean --dry-run' to output the list of gems bundle without having the local path set or providing the '--force' option. This change does not affect the actual behavior of 'bundle clean' which requires either the path being set or use of '--force'.
Closes #5027.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/commands/clean_spec.rb | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index 72d422c3a2..acec0eef95 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -567,7 +567,7 @@ describe "bundle clean" do expect(exitstatus).to eq(0) if exitstatus end - it "doesn't remove gems in dry-run mode" do + it "doesn't remove gems in dry-run mode with path set" do gemfile <<-G source "file://#{gem_repo1}" @@ -595,6 +595,36 @@ describe "bundle clean" do expect(vendored_gems("bin/rackup")).to exist end + it "doesn't remove gems in dry-run mode with no path set" do + gemfile <<-G + source "file://#{gem_repo1}" + + gem "thin" + gem "foo" + G + + bundle "install --path vendor/bundle --no-clean" + + gemfile <<-G + source "file://#{gem_repo1}" + + gem "thin" + G + + bundle :install + + bundle "configuration --delete path" + + bundle "clean --dry-run" + + expect(out).not_to include("Removing foo (1.0)") + expect(out).to include("Would have removed foo (1.0)") + + should_have_gems "thin-1.0", "rack-1.0.0", "foo-1.0" + + expect(vendored_gems("bin/rackup")).to exist + end + it "doesn't store dry run as a config setting" do gemfile <<-G source "file://#{gem_repo1}" |