diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-04-19 20:46:50 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-04-19 20:46:50 -0500 |
commit | 096089a6e5256ddc7363879654b1bba0b1176e52 (patch) | |
tree | f0354bbf43652d6c1f709182e940f72102d128f4 | |
parent | f153ef72f8572eee86e8b1672e29a6a206efb91a (diff) | |
download | bundler-seg-lockfile-duplicates.tar.gz |
Avoid duplicating specs in the lockfile after updating w/ the gem uninstalledseg-lockfile-duplicates
-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 |