audit_spec: override core-tap attribute in online test

This commit is contained in:
lionellloh 2020-06-17 05:19:38 +08:00
parent e8f6e651d1
commit 03fc6b2c15
2 changed files with 14 additions and 17 deletions

View File

@ -357,8 +357,8 @@ module Homebrew
github_license = get_repo_license_data(user, repo)
return if github_license && (github_license == formula.license)
problem "License mismatch - Github license is: #{github_license}, \
but Formulae license states: #{formula.license}."
problem "License mismatch - Github license is: #{github_license}, "\
"but Formulae license states: #{formula.license}."
else
problem "#{formula.license} is not a standard SPDX license id."
end

View File

@ -141,11 +141,11 @@ module Homebrew
expect(fa.problems).to be_empty
end
it "checks online and verifies that a standard license id is the same as what is indicated on its Github repo" do
fa = formula_auditor "cask", <<~RUBY, spdx_ids: spdx_ids, online: true
it "checks online and verifies that a standard license id is the same "\
"as what is indicated on its Github repo" do
fa = formula_auditor "cask", <<~RUBY, spdx_ids: spdx_ids, online: true, core_tap: true
class Cask < Formula
url "https://github.com/cask/cask/archive/v0.8.4.tar.gz"
sha256 "02f8bb20b33b23fb11e7d2a1d282519dfdb8b3090b9672448b8c2c2cacd3e478"
head "https://github.com/cask/cask.git"
license "GPL-3.0"
end
@ -155,23 +155,20 @@ module Homebrew
expect(fa.problems).to be_empty
end
# TODO: fix this test
it "checks online and detects that a formula-specified license is not the same as what is indicated on its Github repository" do
fa = formula_auditor "cask", <<~RUBY, strict: true, online: true, spdx_ids: spdx_ids
it "checks online and detects that a formula-specified license is not "\
"the same as what is indicated on its Github repository" do
# odie "lol"
fa = formula_auditor "cask", <<~RUBY, online: true, spdx_ids: spdx_ids, core_tap: true
class Cask < Formula
desc "Emacs dependency management"
homepage "https://cask.readthedocs.org/"
url "https://github.com/cask/cask/archive/v0.8.4.tar.gz"
sha256 "02f8bb20b33b23fb11e7d2a1d282519dfdb8b3090b9672448b8c2c2cacd3e478"
head "https://github.com/cask/cask.git"
license "0BSD"
license "#{standard_mismatch_spdx_id}"
end
RUBY
fa.audit_license
expect(fa.problems).to be_empty
# match "License mismatch - Github license is: GPL-3.0, \
# but Formulae license states: #{standard_mismatch_spdx_id}."
expect(fa.problems.first).to match "License mismatch - Github license is: GPL-3.0, "\
"but Formulae license states: #{standard_mismatch_spdx_id}."
end
end