From 3f8722c971cedf8b2c66d918fc4dd608bf439009 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 18 Apr 2017 08:17:24 +0100 Subject: audit: allow skipping audit methods. Add `--only` and `--except` methods which can be used to selectively enable or disable audit groups. --- Library/Homebrew/test/dev-cmd/audit_spec.rb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'Library/Homebrew/test/dev-cmd') diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index a6bb22837..8a8096849 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -303,7 +303,7 @@ describe FormulaAuditor do end end - describe "#audit_line" do + describe "#line_problems" do specify "pkgshare" do fa = formula_auditor "foo", <<-EOS.undent, strict: true class Foo < Formula @@ -311,25 +311,25 @@ describe FormulaAuditor do end EOS - fa.audit_line 'ohai "#{share}/foo"', 3 + fa.line_problems 'ohai "#{share}/foo"', 3 expect(fa.problems.shift).to eq("Use \#{pkgshare} instead of \#{share}/foo") - fa.audit_line 'ohai "#{share}/foo/bar"', 3 + fa.line_problems 'ohai "#{share}/foo/bar"', 3 expect(fa.problems.shift).to eq("Use \#{pkgshare} instead of \#{share}/foo") - fa.audit_line 'ohai share/"foo"', 3 + fa.line_problems 'ohai share/"foo"', 3 expect(fa.problems.shift).to eq('Use pkgshare instead of (share/"foo")') - fa.audit_line 'ohai share/"foo/bar"', 3 + fa.line_problems 'ohai share/"foo/bar"', 3 expect(fa.problems.shift).to eq('Use pkgshare instead of (share/"foo")') - fa.audit_line 'ohai "#{share}/foo-bar"', 3 + fa.line_problems 'ohai "#{share}/foo-bar"', 3 expect(fa.problems).to eq([]) - fa.audit_line 'ohai share/"foo-bar"', 3 + fa.line_problems 'ohai share/"foo-bar"', 3 expect(fa.problems).to eq([]) - fa.audit_line 'ohai share/"bar"', 3 + fa.line_problems 'ohai share/"bar"', 3 expect(fa.problems).to eq([]) end @@ -344,11 +344,11 @@ describe FormulaAuditor do end EOS - fa.audit_line 'ohai "#{share}/foolibc++"', 3 + fa.line_problems 'ohai "#{share}/foolibc++"', 3 expect(fa.problems.shift) .to eq("Use \#{pkgshare} instead of \#{share}/foolibc++") - fa.audit_line 'ohai share/"foolibc++"', 3 + fa.line_problems 'ohai share/"foolibc++"', 3 expect(fa.problems.shift) .to eq('Use pkgshare instead of (share/"foolibc++")') end @@ -360,7 +360,7 @@ describe FormulaAuditor do end EOS - fa.audit_line "class Foo