summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Suratna <dennis.suratna@gmail.com>2017-02-27 17:32:03 -0800
committerDennis Suratna <dennis.suratna@gmail.com>2017-02-27 17:36:14 -0800
commitae50b6e774ed86c367fce4fd39fa74e4933ef8f9 (patch)
treec73099d0e3840633cef02e63ff9f73a4c0bdfd4d
parent815200c1a5831710ba3422bf1dcedc5a90c99d2f (diff)
downloadbundler-ae50b6e774ed86c367fce4fd39fa74e4933ef8f9.tar.gz
Fix `bundle outdated --local`. It's supposed to use local cache to determine outdated gems
-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..0227d4b030 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)