From 108c65b43e34aac13d7ab167b8bcb6f26f0ad1dd Mon Sep 17 00:00:00 2001 From: commitay Date: Tue, 27 Mar 2018 08:41:09 +1000 Subject: [PATCH 1/2] cask audit: use @cask.tap --- Library/Homebrew/cask/lib/hbc/audit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/lib/hbc/audit.rb b/Library/Homebrew/cask/lib/hbc/audit.rb index d757b0623d..1ea1522885 100644 --- a/Library/Homebrew/cask/lib/hbc/audit.rb +++ b/Library/Homebrew/cask/lib/hbc/audit.rb @@ -95,7 +95,7 @@ module Hbc def check_version_and_checksum return if @cask.sourcefile_path.nil? - tap = Tap.select { |t| t.cask_file?(@cask.sourcefile_path) }.first + tap = @cask.tap return if tap.nil? return if commit_range.nil? From f9c557bc1a1586730da87199e7b04f6c868698f4 Mon Sep 17 00:00:00 2001 From: commitay Date: Tue, 27 Mar 2018 08:41:32 +1000 Subject: [PATCH 2/2] cask audit: capitalize Cask --- Library/Homebrew/test/cask/audit_spec.rb | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Library/Homebrew/test/cask/audit_spec.rb b/Library/Homebrew/test/cask/audit_spec.rb index ec051c1387..f8462ea568 100644 --- a/Library/Homebrew/test/cask/audit_spec.rb +++ b/Library/Homebrew/test/cask/audit_spec.rb @@ -94,17 +94,17 @@ describe Hbc::Audit, :cask do describe "preflight stanza checks" do let(:error_msg) { "only a single preflight stanza is allowed" } - context "when the cask has no preflight stanza" do + context "when the Cask has no preflight stanza" do let(:cask_token) { "with-zap-rmdir" } it { should_not warn_with(error_msg) } end - context "when the cask has only one preflight stanza" do + context "when the Cask has only one preflight stanza" do let(:cask_token) { "with-preflight" } it { should_not warn_with(error_msg) } end - context "when the cask has multiple preflight stanzas" do + context "when the Cask has multiple preflight stanzas" do let(:cask_token) { "with-preflight-multi" } it { is_expected.to warn_with(error_msg) } end @@ -113,17 +113,17 @@ describe Hbc::Audit, :cask do describe "uninstall_postflight stanza checks" do let(:error_msg) { "only a single postflight stanza is allowed" } - context "when the cask has no postflight stanza" do + context "when the Cask has no postflight stanza" do let(:cask_token) { "with-zap-rmdir" } it { should_not warn_with(error_msg) } end - context "when the cask has only one postflight stanza" do + context "when the Cask has only one postflight stanza" do let(:cask_token) { "with-postflight" } it { should_not warn_with(error_msg) } end - context "when the cask has multiple postflight stanzas" do + context "when the Cask has multiple postflight stanzas" do let(:cask_token) { "with-postflight-multi" } it { is_expected.to warn_with(error_msg) } end @@ -132,17 +132,17 @@ describe Hbc::Audit, :cask do describe "uninstall stanza checks" do let(:error_msg) { "only a single uninstall stanza is allowed" } - context "when the cask has no uninstall stanza" do + context "when the Cask has no uninstall stanza" do let(:cask_token) { "with-zap-rmdir" } it { should_not warn_with(error_msg) } end - context "when the cask has only one uninstall stanza" do + context "when the Cask has only one uninstall stanza" do let(:cask_token) { "with-uninstall-rmdir" } it { should_not warn_with(error_msg) } end - context "when the cask has multiple uninstall stanzas" do + context "when the Cask has multiple uninstall stanzas" do let(:cask_token) { "with-uninstall-multi" } it { is_expected.to warn_with(error_msg) } end @@ -151,17 +151,17 @@ describe Hbc::Audit, :cask do describe "uninstall_preflight stanza checks" do let(:error_msg) { "only a single uninstall_preflight stanza is allowed" } - context "when the cask has no uninstall_preflight stanza" do + context "when the Cask has no uninstall_preflight stanza" do let(:cask_token) { "with-zap-rmdir" } it { should_not warn_with(error_msg) } end - context "when the cask has only one uninstall_preflight stanza" do + context "when the Cask has only one uninstall_preflight stanza" do let(:cask_token) { "with-uninstall-preflight" } it { should_not warn_with(error_msg) } end - context "when the cask has multiple uninstall_preflight stanzas" do + context "when the Cask has multiple uninstall_preflight stanzas" do let(:cask_token) { "with-uninstall-preflight-multi" } it { is_expected.to warn_with(error_msg) } end @@ -170,17 +170,17 @@ describe Hbc::Audit, :cask do describe "uninstall_postflight stanza checks" do let(:error_msg) { "only a single uninstall_postflight stanza is allowed" } - context "when the cask has no uninstall_postflight stanza" do + context "when the Cask has no uninstall_postflight stanza" do let(:cask_token) { "with-zap-rmdir" } it { should_not warn_with(error_msg) } end - context "when the cask has only one uninstall_postflight stanza" do + context "when the Cask has only one uninstall_postflight stanza" do let(:cask_token) { "with-uninstall-postflight" } it { should_not warn_with(error_msg) } end - context "when the cask has multiple uninstall_postflight stanzas" do + context "when the Cask has multiple uninstall_postflight stanzas" do let(:cask_token) { "with-uninstall-postflight-multi" } it { is_expected.to warn_with(error_msg) } end @@ -189,17 +189,17 @@ describe Hbc::Audit, :cask do describe "zap stanza checks" do let(:error_msg) { "only a single zap stanza is allowed" } - context "when the cask has no zap stanza" do + context "when the Cask has no zap stanza" do let(:cask_token) { "with-uninstall-rmdir" } it { should_not warn_with(error_msg) } end - context "when the cask has only one zap stanza" do + context "when the Cask has only one zap stanza" do let(:cask_token) { "with-zap-rmdir" } it { should_not warn_with(error_msg) } end - context "when the cask has multiple zap stanzas" do + context "when the Cask has multiple zap stanzas" do let(:cask_token) { "with-zap-multi" } it { is_expected.to warn_with(error_msg) } end