livecheck: expand #preprocess_url tests more
This commit is contained in:
parent
417bb2ebfd
commit
5a007a4ec6
@ -156,6 +156,12 @@ describe Homebrew::Livecheck do
|
|||||||
describe "::preprocess_url" do
|
describe "::preprocess_url" do
|
||||||
let(:github_git_url_with_extension) { "https://github.com/Homebrew/brew.git" }
|
let(:github_git_url_with_extension) { "https://github.com/Homebrew/brew.git" }
|
||||||
|
|
||||||
|
it "returns the unmodified URL for an unparseable URL" do
|
||||||
|
# Modeled after the `head` URL in the `ncp` formula
|
||||||
|
expect(livecheck.preprocess_url(":something:cvs:@cvs.brew.sh:/cvs"))
|
||||||
|
.to eq(":something:cvs:@cvs.brew.sh:/cvs")
|
||||||
|
end
|
||||||
|
|
||||||
it "returns the unmodified URL for a GitHub URL ending in .git" do
|
it "returns the unmodified URL for a GitHub URL ending in .git" do
|
||||||
expect(livecheck.preprocess_url(github_git_url_with_extension))
|
expect(livecheck.preprocess_url(github_git_url_with_extension))
|
||||||
.to eq(github_git_url_with_extension)
|
.to eq(github_git_url_with_extension)
|
||||||
@ -225,5 +231,10 @@ describe Homebrew::Livecheck do
|
|||||||
expect(livecheck.preprocess_url("https://lolg.it/Homebrew/brew/archive/brew-1.0.0.tar.gz"))
|
expect(livecheck.preprocess_url("https://lolg.it/Homebrew/brew/archive/brew-1.0.0.tar.gz"))
|
||||||
.to eq("https://lolg.it/Homebrew/brew.git")
|
.to eq("https://lolg.it/Homebrew/brew.git")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "returns the Git repository URL for a sourcehut archive URL" do
|
||||||
|
expect(livecheck.preprocess_url("https://git.sr.ht/~Homebrew/brew/archive/1.0.0.tar.gz"))
|
||||||
|
.to eq("https://git.sr.ht/~Homebrew/brew")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user