Don't warn about version designation in cask-versions tap.
This commit is contained in:
parent
2cf655fe98
commit
0d9e28d305
@ -380,8 +380,10 @@ module Cask
|
||||
|
||||
add_warning "cask token contains .app" if token.end_with? ".app"
|
||||
|
||||
if cask.token.end_with? "alpha", "beta", "release candidate"
|
||||
add_warning "cask token contains version designation"
|
||||
if /-(?<designation>alpha|beta|rc|release-candidate)$/ =~ cask.token
|
||||
if cask.tap.official? && cask.tap != "homebrew/cask-versions"
|
||||
add_warning "cask token contains version designation '#{designation}'"
|
||||
end
|
||||
end
|
||||
|
||||
add_warning "cask token mentions launcher" if token.end_with? "launcher"
|
||||
|
||||
@ -212,11 +212,19 @@ describe Cask::Audit, :cask do
|
||||
end
|
||||
end
|
||||
|
||||
context "when cask token contains version" do
|
||||
context "when cask token contains version designation" do
|
||||
let(:cask_token) { "token-beta" }
|
||||
|
||||
it "warns about version in token" do
|
||||
expect(subject).to warn_with(/token contains version/)
|
||||
it "warns about version in token if the cask is from an official tap" do
|
||||
allow(cask).to receive(:tap).and_return(Tap.fetch("homebrew/cask"))
|
||||
|
||||
expect(subject).to warn_with(/token contains version designation/)
|
||||
end
|
||||
|
||||
it "does not warn about version in token if the cask is from the `cask-versions` tap" do
|
||||
allow(cask).to receive(:tap).and_return(Tap.fetch("homebrew/cask-versions"))
|
||||
|
||||
expect(subject).not_to warn_with(/token contains version designation/)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user