diff options
author | Karlo <karlo@aelogica.com> | 2015-06-22 18:18:12 +0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-06-23 21:31:50 -0700 |
commit | 251ac9037bad90f7b6cca2c06a05ac348fc04548 (patch) | |
tree | 0c8c3d647d0e9ebb747bb5b94e050d51c09a2147 | |
parent | 703306a5cf9e66a5a20901d0fa914cf52f5de8a4 (diff) | |
download | bundler-251ac9037bad90f7b6cca2c06a05ac348fc04548.tar.gz |
Don't reinstall bundler when using --force
-rw-r--r-- | lib/bundler/source/rubygems.rb | 6 | ||||
-rw-r--r-- | spec/install/force_spec.rb | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 7b40860db9..bb06830f3e 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -98,7 +98,7 @@ module Bundler end end - if installed_specs[spec].any? && !force + if (installed_specs[spec].any? && !force) || bundler?(spec) Bundler.ui.info "Using #{version_message(spec)}" return nil # no post-install message end @@ -413,6 +413,10 @@ module Bundler spec.loaded_from && spec.loaded_from.include?("specifications/default/") end + def bundler?(spec) + spec.name.eql?('bundler') + end + end end end diff --git a/spec/install/force_spec.rb b/spec/install/force_spec.rb index f86eadaba7..1ab408b009 100644 --- a/spec/install/force_spec.rb +++ b/spec/install/force_spec.rb @@ -17,5 +17,13 @@ describe "bundle install" do should_be_installed "rack 1.0.0" expect(exitstatus).to eq(0) if exitstatus end + + it "doesn't reinstall bundler" do + bundle "install" + bundle "install --force" + expect(out).to_not include "Installing bundler 1.10.4" + expect(out).to include "Using bundler 1.10.4" + end + end end |