aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorGautham Goli2017-07-15 13:34:16 +0530
committerGautham Goli2017-07-15 17:35:10 +0530
commita8f1b02be936f31d6beedbafae38b063f9085486 (patch)
tree6c223401e0ba45fca1b624ddc992a4cfcdc9a7a2 /Library/Homebrew/test
parent83f61830f6346e2a08358a4ca5381b5ffac4fc6e (diff)
downloadbrew-a8f1b02be936f31d6beedbafae38b063f9085486.tar.bz2
audit: Port audit_options rules for new formulae to rubocop and add test
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/rubocops/options_cop_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/Library/Homebrew/test/rubocops/options_cop_spec.rb b/Library/Homebrew/test/rubocops/options_cop_spec.rb
index 161f2a87a..b89b3d9b5 100644
--- a/Library/Homebrew/test/rubocops/options_cop_spec.rb
+++ b/Library/Homebrew/test/rubocops/options_cop_spec.rb
@@ -103,3 +103,30 @@ describe RuboCop::Cop::FormulaAuditStrict::Options do
end
end
end
+
+describe RuboCop::Cop::NewFormulaAudit::Options do
+ subject(:cop) { described_class.new }
+
+ context "When auditing options for a new formula" do
+ it "with deprecated options" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ url 'http://example.com/foo-1.0.tgz'
+ deprecated_option "examples" => "with-examples"
+ end
+ EOS
+
+ expected_offenses = [{ message: described_class::MSG,
+ severity: :convention,
+ line: 3,
+ column: 2,
+ source: source }]
+
+ inspect_source(cop, source)
+
+ expected_offenses.zip(cop.offenses).each do |expected, actual|
+ expect_offense(expected, actual)
+ end
+ end
+ end
+end