From 69d7f2e13ef1c184ad82907ea8e734fe2b726629 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Fri, 27 Jan 2017 16:15:57 +1100 Subject: =?UTF-8?q?add=20failing=20spec=20for=20bundle=20update=20?= =?UTF-8?q?=E2=80=94outdated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/commands/show_spec.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 240bebccbe..28e6433c06 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -161,4 +161,31 @@ RSpec.describe "bundle show" do expect(out).to include("Could not find gem '#{invalid_regexp}'.") end end + + context "--outdated option" do + # Regression test for https://github.com/bundler/bundler/issues/5375 + before do + build_repo2 + end + + it "doesn't update gems to newer versions" do + install_gemfile <<-G + source "file://#{gem_repo2}" + gem "rails" + G + + bundle "install" + + update_repo2 do + build_gem "rails", '3.0.0' do |s| + s.executables = "rails" + end + end + + bundle "show --outdated" + + bundle "install" + expect(the_bundle).to include_gems("rails 2.3.2") + end + end end -- cgit v1.2.1 From f903ba891e27e1b18a7a7aebb49a2715c6efff33 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Fri, 27 Jan 2017 16:26:55 +1100 Subject: remove redundant bundle install --- spec/commands/show_spec.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 28e6433c06..901d8acb7d 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -174,8 +174,6 @@ RSpec.describe "bundle show" do gem "rails" G - bundle "install" - update_repo2 do build_gem "rails", '3.0.0' do |s| s.executables = "rails" -- cgit v1.2.1 From b6ab1faf7cf2a388f6c9961da2e14a23083eacb7 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Tue, 31 Jan 2017 09:01:03 +1100 Subject: fix for bundle show updating gems and spec feedback --- lib/bundler/cli/show.rb | 1 + spec/commands/show_spec.rb | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/bundler/cli/show.rb b/lib/bundler/cli/show.rb index 77e845a603..47d4470aec 100644 --- a/lib/bundler/cli/show.rb +++ b/lib/bundler/cli/show.rb @@ -64,6 +64,7 @@ module Bundler else definition.resolve_with_cache! end + Bundler.reset! definition.specs end diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 901d8acb7d..fb97319096 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -169,21 +169,23 @@ RSpec.describe "bundle show" do end it "doesn't update gems to newer versions" do - install_gemfile <<-G + install_gemfile! <<-G source "file://#{gem_repo2}" gem "rails" G + expect(the_bundle).to include_gem("rails 2.3.2") + update_repo2 do build_gem "rails", '3.0.0' do |s| s.executables = "rails" end end - bundle "show --outdated" + bundle! "show --outdated" - bundle "install" - expect(the_bundle).to include_gems("rails 2.3.2") + bundle! "install" + expect(the_bundle).to include_gem("rails 2.3.2") end end end -- cgit v1.2.1 From bd9afb157b35b77264c0cd32e2744a984d8178ce Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Tue, 31 Jan 2017 12:14:37 +1100 Subject: fix rubocop feedback --- spec/commands/show_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index fb97319096..45af035959 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -177,7 +177,7 @@ RSpec.describe "bundle show" do expect(the_bundle).to include_gem("rails 2.3.2") update_repo2 do - build_gem "rails", '3.0.0' do |s| + build_gem "rails", "3.0.0" do |s| s.executables = "rails" end end -- cgit v1.2.1