summaryrefslogtreecommitdiff
path: root/spec/commands/outdated_spec.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-09-27 16:50:36 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-09-27 16:50:36 +0200
commitde54b58ae0d7d13d0b5f578c45f8cd4acfa6b40a (patch)
treec95d830d406e3c62aed46b38c29728882a10ede0 /spec/commands/outdated_spec.rb
parentfea7fbd655805a039a8291ac588fb76982cb06f6 (diff)
downloadbundler-de54b58ae0d7d13d0b5f578c45f8cd4acfa6b40a.tar.gz
Fix outdated regression with groupless dependenciesfix_outdated_regression
Diffstat (limited to 'spec/commands/outdated_spec.rb')
-rw-r--r--spec/commands/outdated_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb
index a515c6a081..ae54b9d866 100644
--- a/spec/commands/outdated_spec.rb
+++ b/spec/commands/outdated_spec.rb
@@ -143,6 +143,39 @@ RSpec.describe "bundle outdated" do
end
end
+ describe "with --group option and outdated transitive dependencies" do
+ before do
+ update_repo2 do
+ build_gem "bar", %w[2.0.0]
+
+ build_gem "bar_dependant", "7.0" do |s|
+ s.add_dependency "bar", "~> 2.0"
+ end
+ end
+
+ install_gemfile <<-G
+ source "#{file_uri_for(gem_repo2)}"
+
+ gem "bar_dependant", '7.0'
+ G
+
+ update_repo2 do
+ build_gem "bar", %w[3.0.0]
+ end
+ end
+
+ it "returns a sorted list of outdated gems" do
+ bundle "outdated --groups"
+
+ expect(out).to include("===== Without group =====")
+ expect(out).to include("bar (newest 3.0.0, installed 2.0.0)")
+
+ # Gem names are one per-line, between "*" and their parenthesized version.
+ gem_list = out.split("\n").map {|g| g[/\* (.*) \(/, 1] }.compact
+ expect(gem_list).to eq(gem_list.sort)
+ end
+ end
+
describe "with --groups option" do
before do
install_gemfile <<-G