From 03fc6b2c157a20389a0be829562f8a44aeb2a393 Mon Sep 17 00:00:00 2001 From: lionellloh Date: Wed, 17 Jun 2020 05:19:38 +0800 Subject: [PATCH] audit_spec: override core-tap attribute in online test --- Library/Homebrew/dev-cmd/audit.rb | 4 +-- Library/Homebrew/test/dev-cmd/audit_spec.rb | 27 +++++++++------------ 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 94be995ff2..cebaa0766d 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -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 diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index f9692a7b1b..09ca81f4f1 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -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" + url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" + head "https://github.com/cask/cask.git" + 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