Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix broken updates due to incorrect directory filtering #8405

Merged
merged 9 commits into from
Nov 15, 2023
Prev Previous commit
Next Next commit
fix spec
  • Loading branch information
jakecoffman committed Nov 15, 2023
commit dfb81259ba75182f1b3ee45ac17925e6633566a7
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
describe "current_dependency_files" do
let(:files) do
[
Dependabot::DependencyFile.new(name: "Gemfile", content: "mock-gemfile", directory: "/"),
Dependabot::DependencyFile.new(name: "Gemfile.lock", content: "mock-gemfile-lock", directory: "/hello/.."),
Dependabot::DependencyFile.new(name: "Gemfile", content: "mock-package-json", directory: "/elsewhere"),
Dependabot::DependencyFile.new(name: "Gemfile", content: "mock-package-json", directory: "unknown"),
Dependabot::DependencyFile.new(name: "Gemfile", content: "mock-package-json", directory: "../../oob")
Dependabot::DependencyFile.new(name: "Gemfile", content: "mock-gemfile", directory: "/", job_directory: "/"),
Dependabot::DependencyFile.new(name: "Gemfile.lock", content: "mock-gemfile-lock", directory: "/hello/..",
job_directory: "/"),
Dependabot::DependencyFile.new(name: "Gemfile", content: "mock-package-json", directory: "/elsewhere",
job_directory: "/other"),
Dependabot::DependencyFile.new(name: "Gemfile", content: "mock-package-json", directory: "unknown",
job_directory: "/hello"),
Dependabot::DependencyFile.new(name: "Gemfile", content: "mock-package-json", directory: "../../oob",
job_directory: "/oob")
]
end

Expand Down Expand Up @@ -53,21 +57,5 @@
.current_dependency_files(job).map(&:name)).to eq(%w(Gemfile Gemfile.lock))
end
end

context "when the package manager is github-actions" do
let(:package_manager) { "github_actions" }
let(:files) do
[
Dependabot::DependencyFile.new(name: "workflow.yml", content: "mock-workflow",
directory: "/.github/workflows"),
Dependabot::DependencyFile.new(name: "common.yml", content: "mock-gemfile-lock", directory: "/reusable")
]
end

it "returns the current dependency files filtered by directory" do
expect(described_class.new(initial_dependency_files: files)
.current_dependency_files(job).map(&:name)).to eq(%w(workflow.yml))
end
end
end
end