Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-bar committed Oct 18, 2024
1 parent 5c1b922 commit 20a5603
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 0 additions & 2 deletions terraform/lib/dependabot/terraform/requirements_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
require "dependabot/terraform/version"
require "dependabot/terraform/requirement"

require 'logger'

module Dependabot
module Terraform
# Takes an array of `requirements` hashes for a dependency at the old
Expand Down
18 changes: 12 additions & 6 deletions terraform/spec/dependabot/terraform/requirements_updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,37 +77,43 @@
end
end

context "and a <= requirement was previously specified" do
context "when <= requirement was previously specified" do
context "that is satisfied" do
let(:requirement) { "<= 0.3.7" }

it { is_expected.to eq(requirements.first) }
end

context "that is not satisfied" do
context "when it is not satisfied" do
let(:requirement) { "<= 0.1.9" }

its([:requirement]) { is_expected.to eq("<= 0.3.7") }

context "specifying two digits" do
context "when specifying two version segments" do
let(:requirement) { "<= 0.3" }
let(:latest_version) { version_class.new("2.8.5") }

its([:requirement]) { is_expected.to eq("<= 2.8.5") }
end

context "specifying three digits" do
context "when specifying three version segments" do
let(:requirement) { "<= 0.3.7" }
let(:latest_version) { version_class.new("2.8.5") }

its([:requirement]) { is_expected.to eq("<= 2.8.5") }
end

context "minor and patch updated" do
context "when minor and patch updated" do
let(:requirement) { "<= 0.3.7" }
let(:latest_version) { version_class.new("0.4.0") }

its([:requirement]) { is_expected.to eq("<= 0.4.0") }
end

context "major, minor and patch updated" do
context "when major, minor and patch updated" do
let(:requirement) { "<= 0.3.7" }
let(:latest_version) { version_class.new("1.4.0") }

its([:requirement]) { is_expected.to eq("<= 1.4.0") }
end
end
Expand Down

0 comments on commit 20a5603

Please sign in to comment.