Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Fix bundle outdated --local. It's supposed to use local cache to dete… #5483

Merged
merged 2 commits into from
Feb 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/bundler/cli/outdated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ def run
%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]
Expand Down
15 changes: 15 additions & 0 deletions spec/commands/outdated_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,21 @@ def test_group_option(group = nil, gems_list_size = 1)
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)

Expand Down