summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsh Wilson <ash.wilson@rackspace.com>2014-01-08 17:32:58 -0500
committerGabriel Jaldon <gjaldon85@gmail.com>2014-04-19 01:24:13 +0800
commita951bf97e5fd9eac0aad6a91c43b8fa35736492a (patch)
tree8eee9557e2e3fc3dcce2852573da9411774afd08
parent1e048c7cc5080a8794bcf1c730d4551df5e0ec73 (diff)
downloadbundler-a951bf97e5fd9eac0aad6a91c43b8fa35736492a.tar.gz
Autoinstall during "bundle clean".
-rw-r--r--lib/bundler/cli.rb1
-rw-r--r--spec/commands/clean_spec.rb24
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 8475b198fd..10fea9ca72 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -355,6 +355,7 @@ module Bundler
"forces clean even if --path is not set"
def clean
require 'bundler/cli/clean'
+ auto_install if Bundler.settings[:path] || options[:force]
Clean.new(options.dup).run
end
diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb
index cee1312a5f..a5023a3d54 100644
--- a/spec/commands/clean_spec.rb
+++ b/spec/commands/clean_spec.rb
@@ -589,4 +589,28 @@ describe "bundle clean" do
expect(vendored_gems("bin/rackup")).to exist
end
+
+ it "performs an automatic bundle install" 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"
+ gem "weakling"
+ G
+
+ bundle "config auto_install 1"
+ bundle :clean
+ expect(out).to include('Installing weakling 0.0.3')
+ should_have_gems 'thin-1.0', 'rack-1.0.0', 'weakling-0.0.3'
+ should_not_have_gems 'foo-1.0'
+ end
end