From 71b6e239d722bd1d444a5c5e2777d61208cc8049 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 9 Oct 2017 18:27:02 +0200 Subject: Set RuboCop maximum to current maximum. --- Library/Homebrew/test/cmd/style_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Library/Homebrew/test') diff --git a/Library/Homebrew/test/cmd/style_spec.rb b/Library/Homebrew/test/cmd/style_spec.rb index 4701036f1..9bc8fcab1 100644 --- a/Library/Homebrew/test/cmd/style_spec.rb +++ b/Library/Homebrew/test/cmd/style_spec.rb @@ -4,12 +4,12 @@ describe "brew style" do around(:each) do |example| begin FileUtils.ln_s HOMEBREW_LIBRARY_PATH, HOMEBREW_LIBRARY/"Homebrew" - FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop.yml", HOMEBREW_LIBRARY/".auditcops.yml" + FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop.yml", HOMEBREW_LIBRARY/".rubocop_audit.yml" example.run ensure FileUtils.rm_f HOMEBREW_LIBRARY/"Homebrew" - FileUtils.rm_f HOMEBREW_LIBRARY/".auditcops.yml" + FileUtils.rm_f HOMEBREW_LIBRARY/".rubocop_audit.yml" end end -- cgit v1.2.3 From 29070e5cbecad6553b29bb482ce94352682b9c64 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Tue, 10 Oct 2017 15:43:07 +0100 Subject: formula_desc_cop_spec: add empty string test --- .../Homebrew/test/rubocops/formula_desc_cop_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Library/Homebrew/test') diff --git a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb index ac8893e18..4816c3b26 100644 --- a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb @@ -27,6 +27,27 @@ describe RuboCop::Cop::FormulaAuditStrict::DescLength do end end + it "reports an offense when desc is an empty string" do + source = <<-EOS.undent + class Foo < Formula + url 'http://example.com/foo-1.0.tgz' + desc '' + end + EOS + + msg = "The desc (description) should not be an empty string." + expected_offenses = [{ message: msg, + severity: :convention, + line: 3, + column: 2, + source: source }] + + inspect_source(source, "/homebrew-core/Formula/foo.rb") + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + it "When desc is too long" do source = <<-EOS.undent class Foo < Formula -- cgit v1.2.3