Skip to content

Commit

Permalink
removed unused unsupported_versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
kbukum1 committed Oct 21, 2024
1 parent eabb3ce commit 96e2840
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 37 deletions.
17 changes: 14 additions & 3 deletions common/lib/dependabot/package_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,21 @@ class PackageManagerBase
# @param deprecated_versions [Array<Dependabot::Version>] an array of deprecated versions.
# @param supported_versions [Array<Dependabot::Version>] an array of supported versions.
sig do
params(ecosystem: String, name: String, version: Dependabot::Version,
deprecated_versions: T::Array[Dependabot::Version], supported_versions: T::Array[Dependabot::Version]).void
params(
ecosystem: String,
name: String,
version: Dependabot::Version,
deprecated_versions: T::Array[Dependabot::Version],
supported_versions: T::Array[Dependabot::Version]
).void
end
def initialize(ecosystem, name, version, deprecated_versions = [], supported_versions = [])
def initialize(
ecosystem,
name,
version,
deprecated_versions = [],
supported_versions = []
)
@ecosystem = T.let(ecosystem, String)
@name = T.let(name, String)
@version = T.let(version, Dependabot::Version)
Expand Down
48 changes: 14 additions & 34 deletions common/spec/dependabot/package_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,14 @@
RSpec.describe Dependabot::PackageManagerBase do # rubocop:disable RSpec/FilePath,RSpec/SpecFilePathFormat
let(:concrete_class) do
Class.new(Dependabot::PackageManagerBase) do
def name
"bundler"
end

def version
@version ||= Dependabot::Version.new("1.0.0")
end

def deprecated_versions
[Dependabot::Version.new("1")]
end

def unsupported_versions
[Dependabot::Version.new("0")]
end

def supported_versions
@supported_versions ||= [Dependabot::Version.new("1"), Dependabot::Version.new("2")]
def initialize
super(
"bundler", # ecosystem
"bundler", # name
Dependabot::Version.new("1.0.0"), # version
[Dependabot::Version.new("1")], # deprecated_versions
[Dependabot::Version.new("1"), Dependabot::Version.new("2")] # supported_versions
)
end

sig { override.returns(T::Boolean) }
Expand All @@ -49,12 +39,12 @@ def support_later_versions?

let(:default_concrete_class) do
Class.new(Dependabot::PackageManagerBase) do
def name
"bundler"
end

def version
Dependabot::Version.new("1.0.0")
def initialize
super(
"bundler", # ecosystem
"bundler", # name
Dependabot::Version.new("1.0.0"), # version
)
end
end
end
Expand Down Expand Up @@ -84,16 +74,6 @@ def version
end
end

describe "#unsupported_versions" do
it "returns an array of unsupported versions" do
expect(package_manager.unsupported_versions).to eq([Dependabot::Version.new("0")])
end

it "returns an empty array by default" do
expect(default_package_manager.unsupported_versions).to eq([])
end
end

describe "#supported_versions" do
it "returns an array of supported versions" do
expect(package_manager.supported_versions).to eq([
Expand Down

0 comments on commit 96e2840

Please sign in to comment.