-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
243 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
python/spec/dependabot/python/pip_compile_package_manager_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# typed: false | ||
# frozen_string_literal: true | ||
|
||
require "dependabot/python/package_manager" | ||
require "dependabot/ecosystem" | ||
require "spec_helper" | ||
|
||
RSpec.describe Dependabot::Python::PipCompilePackageManager do | ||
let(:package_manager) { described_class.new("2024.0.1") } | ||
|
||
describe "#initialize" do | ||
context "when version is a String" do | ||
it "sets the version correctly" do | ||
expect(package_manager.version).to eq("2024.0.1") | ||
end | ||
|
||
it "sets the name correctly" do | ||
expect(package_manager.name).to eq("pip-compile") | ||
end | ||
end | ||
|
||
context "when pip-compile version extracted from pyenv is well formed" do | ||
# If this test starts failing, you need to adjust the "detect_pipenv_version" function | ||
# to return a valid version in format x.x, x.x.x etc. examples: 3.12.5, 3.12 | ||
version = Dependabot::SharedHelpers.run_shell_command("pyenv exec pip-compile --version") | ||
.to_s.split("version ").last&.split(")")&.first | ||
|
||
it "does not raise error" do | ||
expect(version.match(/^\d+(?:\.\d+)*$/)).to be_truthy | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
python/spec/dependabot/python/pipenv_package_manager_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# typed: false | ||
# frozen_string_literal: true | ||
|
||
require "dependabot/python/package_manager" | ||
require "dependabot/ecosystem" | ||
require "spec_helper" | ||
|
||
RSpec.describe Dependabot::Python::PipenvPackageManager do | ||
let(:package_manager) { described_class.new("1.8.3") } | ||
|
||
describe "#initialize" do | ||
context "when version is a String" do | ||
it "sets the version correctly" do | ||
expect(package_manager.version).to eq("1.8.3") | ||
end | ||
|
||
it "sets the name correctly" do | ||
expect(package_manager.name).to eq("pipenv") | ||
end | ||
end | ||
|
||
context "when pipenv version extracted from pyenv is well formed" do | ||
# If this test starts failing, you need to adjust the "detect_pipenv_version" function | ||
# to return a valid version in format x.x, x.x.x etc. examples: 3.12.5, 3.12 | ||
version = Dependabot::SharedHelpers.run_shell_command("pyenv exec pipenv --version") | ||
.to_s.split("version ").last&.strip | ||
|
||
it "does not raise error" do | ||
expect(version.match(/^\d+(?:\.\d+)*$/)).to be_truthy | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters