diff options
| author | Gautham Goli | 2017-08-15 00:05:50 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-08-15 00:27:09 +0530 |
| commit | cfc423e1839442f605072db14aac42f6f5fa6174 (patch) | |
| tree | 8ac198886cfc56e3da87cb5ab365c5cd15ab7ba0 /Library/Homebrew/test | |
| parent | d2a7314f538f919e9b09e4b27c1f86b7d3d2eda2 (diff) | |
| download | brew-cfc423e1839442f605072db14aac42f6f5fa6174.tar.bz2 | |
add tests for dependencies
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/rubocops/lines_cop_spec.rb | 22 |
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 be2b63c47..1273ef9c9 100644 --- a/Library/Homebrew/test/rubocops/lines_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_cop_spec.rb @@ -1095,6 +1095,28 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do end end + it "with dependencies with invalid options" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + depends_on "foo" => "with-bar" + end + EOS + + expected_offenses = [{ message: "Dependency foo should not use option with-bar", + severity: :convention, + line: 4, + column: 13, + 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]) |
