summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-10-25 00:56:07 +0000
committerThe Bundler Bot <bot@bundler.io>2017-10-25 00:56:07 +0000
commit2ae308600772ca69267ea0945f465b4de7fcadba (patch)
tree15e6f044d3e410631e31d4988d870fa470641c2b
parentb9c12ee67661581f8a4fb5f47a375b5c7da2ed1e (diff)
parentcec3f58cb9219e0ba6e5b6abf3c7fe0372d01d1b (diff)
downloadbundler-2ae308600772ca69267ea0945f465b4de7fcadba.tar.gz
Auto merge of #6116 - bundler:seg-outdated-second-group, r=colby-swandale
[Outdated] Support --group with the second group for a dependency ### What was the end-user problem that led to this PR? The problem was `bundle outdated --group NAME` wouldn't work if it was the second group for the dependency. Closes #6115. ### What was your diagnosis of the problem? My diagnosis was we were joining with `, ` and splitting on `,`, so subsequent groups had an additional space.
-rw-r--r--lib/bundler/cli/outdated.rb2
-rw-r--r--spec/commands/outdated_spec.rb11
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index 9e4700ea52..d0639f0e74 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -118,7 +118,7 @@ module Bundler
[nil, ordered_groups].flatten.each do |groups|
gems = outdated_gems_by_groups[groups]
contains_group = if groups
- groups.split(",").include?(options[:group])
+ groups.split(", ").include?(options[:group])
else
options[:group] == "group"
end
diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb
index 0a9e430338..877e648f5d 100644
--- a/spec/commands/outdated_spec.rb
+++ b/spec/commands/outdated_spec.rb
@@ -135,6 +135,17 @@ RSpec.describe "bundle outdated" do
expect(out).to include("activesupport")
expect(out).to include("duradura")
end
+
+ it "returns a sorted list of outdated gems from one group => 'test'" do
+ test_group_option("test", 2)
+
+ expect(out).not_to include("===== Group default =====")
+ expect(out).not_to include("terranova (")
+
+ expect(out).to include("===== Group development, test =====")
+ expect(out).to include("activesupport")
+ expect(out).to include("duradura")
+ end
end
describe "with --groups option" do