diff options
author | The Bundler Bot <bot@bundler.io> | 2017-04-21 17:17:02 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2017-04-21 17:17:02 +0000 |
commit | 8e2cd4ac9b1b0c3459b5969af364b318821121e5 (patch) | |
tree | e1f57429786db11d6b0bb7ac93da6c0cd0e6c8ab | |
parent | ec06cf0788bd1f82697a6e12748d997030bfe1ea (diff) | |
parent | 096089a6e5256ddc7363879654b1bba0b1176e52 (diff) | |
download | bundler-8e2cd4ac9b1b0c3459b5969af364b318821121e5.tar.gz |
Auto merge of #5600 - bundler:seg-lockfile-duplicates, r=segiddins
Avoid duplicating specs in the lockfile after updating w/ the gem uninstalled
Closes https://github.com/bundler/bundler/issues/5599
I decided to not compare using `full_name` in `SpecSet#merge` for the sake of performance, since `#full_name` is uncached
-rw-r--r-- | lib/bundler/lazy_specification.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/compact_index_spec.rb | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb index 9a8268a2d5..8d9a02c2b8 100644 --- a/lib/bundler/lazy_specification.rb +++ b/lib/bundler/lazy_specification.rb @@ -29,7 +29,7 @@ module Bundler @name = name @version = version @dependencies = [] - @platform = platform + @platform = platform || Gem::Platform::RUBY @source = source @specification = nil end diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb index 87f59e32c8..6f35a50226 100644 --- a/spec/install/gems/compact_index_spec.rb +++ b/spec/install/gems/compact_index_spec.rb @@ -769,4 +769,16 @@ Bundler::APIResponseMismatchError: Downloading rails-2.3.2 revealed dependencies Either installing with `--full-index` or running `bundle update rails` should fix the problem. E end + + it "does not duplicate specs in the lockfile when updating and a dependency is not installed" do + install_gemfile! <<-G, :artifice => "compact_index" + source "#{source_uri}" do + gem "rails" + gem "activemerchant" + end + G + gem_command! :uninstall, "activemerchant" + bundle! "update rails", :artifice => "compact_index" + expect(lockfile.scan(/activemerchant \(/).size).to eq(1) + end end |