Skip to content

Commit

Permalink
Dep: Ignore indirect dependencies in latest_resolvable_version_with_n…
Browse files Browse the repository at this point in the history
…o_unlock
  • Loading branch information
greysteil committed Jan 15, 2019
1 parent 895d147 commit 8ffd949
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dep/lib/dependabot/dep/update_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def latest_resolvable_version
end

def latest_resolvable_version_with_no_unlock
# We don't yet support updating indirect dependencies for dep
return dependency.version unless dependency.top_level?

@latest_resolvable_version_with_no_unlock ||=
if git_dependency?
latest_resolvable_commit_with_unchanged_git_source
Expand Down
10 changes: 10 additions & 0 deletions dep/spec/dependabot/dep/update_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@
expect(latest_resolvable_version).to eq(Gem::Version.new("3.2.0"))
end

context "with an indirect dependency" do
let(:requirements) { [] }
it { is_expected.to eq(dependency.version) }
end

context "with a manifest file that needs unlocking" do
let(:manifest_fixture_name) { "bare_version.toml" }
let(:lockfile_fixture_name) { "bare_version.lock" }
Expand Down Expand Up @@ -383,6 +388,11 @@
to eq(Gem::Version.new("3.2.0"))
end

context "with an indirect dependency" do
let(:requirements) { [] }
it { is_expected.to eq(dependency.version) }
end

context "with a manifest file that needs unlocking" do
let(:manifest_fixture_name) { "bare_version.toml" }
let(:lockfile_fixture_name) { "bare_version.lock" }
Expand Down

0 comments on commit 8ffd949

Please sign in to comment.