diff options
-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 |