cask audit: review changes
This commit is contained in:
parent
c354d76e47
commit
b9b3952494
@ -255,14 +255,14 @@ module Hbc
|
||||
def check_github_releases_appcast
|
||||
return unless cask.url.to_s =~ %r{github.com/([^/]+)/([^/]+)/releases/download/(\S+)}
|
||||
|
||||
add_warning "Cask uses GitHub releases, please add an appcast. See https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/appcast.md"
|
||||
add_warning "Download uses GitHub releases, please add an appcast. See https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/appcast.md"
|
||||
end
|
||||
|
||||
def check_sourceforge_appcast
|
||||
return if cask.version.latest?
|
||||
return unless cask.url.to_s =~ %r{sourceforge.net/(\S+)}
|
||||
|
||||
add_warning "Cask hosted on SourceForge, please add an appcast. See https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/appcast.md"
|
||||
add_warning "Download is hosted on SourceForge, please add an appcast. See https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/appcast.md"
|
||||
end
|
||||
|
||||
def check_url
|
||||
|
||||
@ -439,46 +439,46 @@ describe Hbc::Audit, :cask do
|
||||
end
|
||||
|
||||
describe "GitHub releases appcast check" do
|
||||
let(:error_msg) { /Cask uses GitHub releases/ }
|
||||
let(:appcast_warning) { /Download uses GitHub releases/ }
|
||||
|
||||
context "when the Cask does not use GitHub releases" do
|
||||
context "when the download does not use GitHub releases" do
|
||||
let(:cask_token) { "basic-cask" }
|
||||
|
||||
it { is_expected.not_to warn_with(error_msg) }
|
||||
it { is_expected.not_to warn_with(appcast_warning) }
|
||||
end
|
||||
|
||||
context "when the Cask uses GitHub releases and has an appcast" do
|
||||
context "when the download uses GitHub releases and has an appcast" do
|
||||
let(:cask_token) { "github-with-appcast" }
|
||||
|
||||
it { is_expected.not_to warn_with(error_msg) }
|
||||
it { is_expected.not_to warn_with(appcast_warning) }
|
||||
end
|
||||
|
||||
context "when the Cask uses GitHub releases and does not have an appcast" do
|
||||
context "when the download uses GitHub releases and does not have an appcast" do
|
||||
let(:cask_token) { "github-without-appcast" }
|
||||
|
||||
it { is_expected.to warn_with(error_msg) }
|
||||
it { is_expected.to warn_with(appcast_warning) }
|
||||
end
|
||||
end
|
||||
|
||||
describe "SourceForge appcast check" do
|
||||
let(:error_msg) { /Cask hosted on SourceForge/ }
|
||||
let(:appcast_warning) { /Download is hosted on SourceForge/ }
|
||||
|
||||
context "when the Cask is not hosted on SourceForge" do
|
||||
context "when the download is not hosted on SourceForge" do
|
||||
let(:cask_token) { "basic-cask" }
|
||||
|
||||
it { is_expected.not_to warn_with(error_msg) }
|
||||
it { is_expected.not_to warn_with(appcast_warning) }
|
||||
end
|
||||
|
||||
context "when the Cask is hosted on SourceForge and has an appcast" do
|
||||
context "when the download is hosted on SourceForge and has an appcast" do
|
||||
let(:cask_token) { "sourceforge-with-appcast" }
|
||||
|
||||
it { is_expected.not_to warn_with(error_msg) }
|
||||
it { is_expected.not_to warn_with(appcast_warning) }
|
||||
end
|
||||
|
||||
context "when the Cask is hosted on SourceForge and does not have an appcast" do
|
||||
context "when the download is hosted on SourceForge and does not have an appcast" do
|
||||
let(:cask_token) { "sourceforge-correct-url-format" }
|
||||
|
||||
it { is_expected.to warn_with(error_msg) }
|
||||
it { is_expected.to warn_with(appcast_warning) }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user