Skip to content

Commit

Permalink
Cover file updater not updating past target version
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Jan 18, 2024
1 parent b870ed7 commit fd70cb9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions devcontainers/spec/dependabot/devcontainers/file_updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,40 @@
expect(config.content).to include('"version": "2.4.0"')
end
end

context "when target version is not the latest" do
let(:dependencies) do
[
Dependabot::Dependency.new(
name: "ghcr.io/codspace/versioning/foo",
version: "2.10.0",
previous_version: "1.1.0",
requirements: [{
requirement: "2",
groups: ["feature"],
file: ".devcontainer.json",
source: nil
}],
previous_requirements: [{
requirement: "2",
groups: ["feature"],
file: ".devcontainer.json",
source: nil
}],
package_manager: "devcontainers"
)
]
end

let(:project_name) { "updated_manifest_outdated_lockfile" }

it "does not go past the target version in the lockfile" do
expect(subject.size).to eq(1)

lockfile = subject.first
expect(lockfile.name).to eq(".devcontainer-lock.json")
expect(lockfile.content).to include('"version": "2.10.0"')
end
end
end
end

0 comments on commit fd70cb9

Please sign in to comment.