summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-02-28 06:07:38 +0000
committerThe Bundler Bot <bot@bundler.io>2017-02-28 06:07:38 +0000
commit0b25fae2c564ec61ef0e59b2f17b91f2fe6b55a2 (patch)
tree153ee77d8ed05fde0b1bc71ff38511a3aa42db9a
parent26489ed0754c3f29af76be166a2122c7dc191af5 (diff)
parenta14bec05c2b59a0ca38660972430c515a3afdca2 (diff)
downloadbundler-0b25fae2c564ec61ef0e59b2f17b91f2fe6b55a2.tar.gz
Auto merge of #5483 - denniss:5430-fix-bundle-outdated-local, r=segiddins
Fix bundle outdated --local. It's supposed to use local cache to deteā€¦ Fixes https://github.com/bundler/bundler/issues/5430
-rw-r--r--lib/bundler/cli/outdated.rb3
-rw-r--r--spec/commands/outdated_spec.rb15
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index 27d607d6d5..93e50b10b6 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -49,8 +49,7 @@ module Bundler
%w(filter-major filter-minor filter-patch)
definition_resolution = proc do
- return definition.resolve_with_cache! if options[:local]
- definition.resolve_remotely!
+ options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
end
if options[:parseable]
diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb
index eb47557d29..b927a0be2b 100644
--- a/spec/commands/outdated_spec.rb
+++ b/spec/commands/outdated_spec.rb
@@ -187,6 +187,21 @@ RSpec.describe "bundle outdated" do
end
describe "with --local option" do
+ it "uses local cache to return a list of outdated gems" do
+ update_repo2 do
+ build_gem "activesupport", "2.3.4"
+ end
+
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "activesupport", "2.3.4"
+ G
+
+ bundle "outdated --local"
+
+ expect(out).to include("activesupport (newest 2.3.5, installed 2.3.4, requested = 2.3.4)")
+ end
+
it "doesn't hit repo2" do
FileUtils.rm_rf(gem_repo2)