diff options
author | The Bundler Bot <bot@bundler.io> | 2018-06-15 05:41:58 +0000 |
---|---|---|
committer | Colby Swandale <hello@colby.fyi> | 2018-08-16 21:42:28 +1000 |
commit | aa65090c78cc7e0b07bce4ef965bf2eb95839a58 (patch) | |
tree | 2e208c9b39f97f89d696b3976f437397a169050b /spec | |
parent | 12e73cab71647c2bbc8f443c2d899533febfef53 (diff) | |
download | bundler-aa65090c78cc7e0b07bce4ef965bf2eb95839a58.tar.gz |
Auto merge of #6568 - greysteil:conservative-groups, r=segiddins
Respect --conservative flag when updating a dependency group
Previously, we were using `Bundler.definition.specs_for groups` to get the list of dependencies to unlock when updating a specific group. That method returns all sub-dependencies for the dependencies in the group, too, which were therefore being unlocked and --conservative was being ignored.
This PR ensures `--conservative` is respected for group updates by selecting the dependencies for the group directly from the definition instead. It adds a test to ensure we don't accidentally regress.
Fixes https://github.com/bundler/bundler/issues/6560.
(cherry picked from commit c171c54c095a241584aa03c792a9946ec8313c22)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/commands/update_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb index 6b18d0c8c1..675e8574f1 100644 --- a/spec/commands/update_spec.rb +++ b/spec/commands/update_spec.rb @@ -176,6 +176,23 @@ RSpec.describe "bundle update" do expect(the_bundle).not_to include_gems "rack 1.2" end + context "when conservatively updating a group with non-group sub-deps" do + it "should update only specified group gems" do + install_gemfile <<-G + source "file://#{gem_repo2}" + gem "activemerchant", :group => :development + gem "activesupport" + G + update_repo2 do + build_gem "activemerchant", "2.0" + build_gem "activesupport", "3.0" + end + bundle "update --conservative --group development" + expect(the_bundle).to include_gems "activemerchant 2.0" + expect(the_bundle).not_to include_gems "activesupport 3.0" + end + end + context "when there is a source with the same name as a gem in a group" do before :each do build_git "foo", :path => lib_path("activesupport") |