diff options
| author | Gautham Goli | 2017-08-14 02:49:52 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-08-14 02:49:52 +0530 |
| commit | dc4d10ff6a59ce0da1bfc7bc06dd819c442813ab (patch) | |
| tree | 2bad9c6bad7544be9027b3dd929e259b514f978b /Library/Homebrew/test | |
| parent | 3ff8be1216388817dda2b4bb95aeaa5c3d3d5a6b (diff) | |
| download | brew-dc4d10ff6a59ce0da1bfc7bc06dd819c442813ab.tar.bz2 | |
add test for build.include? having dashed args
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/rubocops/lines_cop_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Library/Homebrew/test/rubocops/lines_cop_spec.rb b/Library/Homebrew/test/rubocops/lines_cop_spec.rb index 36c6272b3..288ca8f8f 100644 --- a/Library/Homebrew/test/rubocops/lines_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_cop_spec.rb @@ -787,6 +787,30 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do expect_offense(expected, actual) end end + + it "with build.include? with dashed args" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + def post_install + return if build.include? "--bar" + end + end + EOS + + expected_offenses = [{ message: "Reference 'bar' without dashes", + severity: :convention, + line: 5, + column: 30, + 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]) |
