aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/rubocops
diff options
context:
space:
mode:
authorGautham Goli2017-08-14 23:05:00 +0530
committerGautham Goli2017-08-14 23:05:00 +0530
commit64a929184a45f530a49af7b047d5b6605b50b1f8 (patch)
tree552e6aad8e6a60a3033bd2c0569391fee7f0a189 /Library/Homebrew/test/rubocops
parent063cbe7acdb0af0a4cd9bd35f29f89bc0d638d4a (diff)
downloadbrew-64a929184a45f530a49af7b047d5b6605b50b1f8.tar.bz2
add tests for vendored deps
Diffstat (limited to 'Library/Homebrew/test/rubocops')
-rw-r--r--Library/Homebrew/test/rubocops/lines_cop_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/Library/Homebrew/test/rubocops/lines_cop_spec.rb b/Library/Homebrew/test/rubocops/lines_cop_spec.rb
index 1d25c4721..f3626cdce 100644
--- a/Library/Homebrew/test/rubocops/lines_cop_spec.rb
+++ b/Library/Homebrew/test/rubocops/lines_cop_spec.rb
@@ -1051,6 +1051,28 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
end
end
+ it "with dependecies which have to vendored" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ depends_on "lpeg" => :lua51
+ end
+ EOS
+
+ expected_offenses = [{ message: "lua modules should be vendored rather than use deprecated depends_on \"lpeg\" => :lua51`",
+ severity: :convention,
+ line: 4,
+ column: 24,
+ source: source }]
+
+ inspect_source(cop, source)
+
+ expected_offenses.zip(cop.offenses).each do |expected, actual|
+ expect_offense(expected, actual)
+ end
+ end
+
end
def expect_offense(expected, actual)
expect(actual.message).to eq(expected[:message])