From a951bf97e5fd9eac0aad6a91c43b8fa35736492a Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Wed, 8 Jan 2014 17:32:58 -0500 Subject: Autoinstall during "bundle clean". --- lib/bundler/cli.rb | 1 + spec/commands/clean_spec.rb | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) 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 -- cgit v1.2.1