summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-02-01 19:23:40 +0000
committerThe Bundler Bot <bot@bundler.io>2017-02-01 19:23:40 +0000
commitd9d699c174a06da8052bc7da0d5ba64438968653 (patch)
treef556c9e9c622f0792e9ce792575646294a16234e
parentfb8c5a7e509cb0a54a4b34f8a93b86484241a747 (diff)
parentbd9afb157b35b77264c0cd32e2744a984d8178ce (diff)
downloadbundler-d9d699c174a06da8052bc7da0d5ba64438968653.tar.gz
Auto merge of #5376 - colby-swandale:bundle-show-update-lock, r=segiddins
Bundle show --outdated shouldn't be updating versions This PR is for #5375. I have added a spec (currently failing) of the desired behavior for `bundle show --outdated` I'm currently looking into a fix for this but welcome anyone else to come in as well.
-rw-r--r--lib/bundler/cli/show.rb1
-rw-r--r--spec/commands/show_spec.rb27
2 files changed, 28 insertions, 0 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 240bebccbe..45af035959 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
+
+ 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! "install"
+ expect(the_bundle).to include_gem("rails 2.3.2")
+ end
+ end
end