-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16238 from abitrolly/create-urlparse
create: Fix getting name from GitHub archives
- Loading branch information
Showing
3 changed files
with
63 additions
and
22 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
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,30 @@ | ||
# frozen_string_literal: true | ||
|
||
require "formula_creator" | ||
|
||
describe Homebrew::FormulaCreator do | ||
it "gets name from GitHub archive URL" do | ||
t = described_class.name_from_url("https://github.com/abitrolly/lapce/archive/v0.3.0.tar.gz") | ||
expect(t).to eq("lapce") | ||
end | ||
|
||
it "gets name from gitweb URL" do | ||
t = described_class.name_from_url("http://www.codesrc.com/gitweb/index.cgi?p=libzipper.git;a=summary") | ||
expect(t).to eq("libzipper") | ||
end | ||
|
||
it "gets name from GitHub repo URL" do | ||
t = described_class.name_from_url("https://github.com/abitrolly/lapce.git") | ||
expect(t).to eq("lapce") | ||
end | ||
|
||
it "gets name from GitHub download URL" do | ||
t = described_class.name_from_url("https://github.com/stella-emu/stella/releases/download/6.7/stella-6.7-src.tar.xz") | ||
expect(t).to eq("stella") | ||
end | ||
|
||
it "gets name from generic tarball URL" do | ||
t = described_class.name_from_url("http://digit-labs.org/files/tools/synscan/releases/synscan-5.02.tar.gz") | ||
expect(t).to eq("synscan") | ||
end | ||
end |