diff options
| author | Gautham Goli | 2017-08-15 00:32:34 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-08-15 00:32:34 +0530 |
| commit | 3fc6cc1a3a4b8f1b7ca42dc0a7dd7cf8fad91b18 (patch) | |
| tree | 859c39207aa1d7950343d1048ffa4cdf5b831647 /Library/Homebrew/test | |
| parent | 5744cd9066bbdfc4db5332a202ddb962d5359ee5 (diff) | |
| download | brew-3fc6cc1a3a4b8f1b7ca42dc0a7dd7cf8fad91b18.tar.bz2 | |
add test for ENV.fortran
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 f24a6b09d..1b23cca83 100644 --- a/Library/Homebrew/test/rubocops/lines_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_cop_spec.rb @@ -1141,6 +1141,30 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do end end + it "with ENV.fortran" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + test do + ENV.fortran + end + end + EOS + + expected_offenses = [{ message: "Use `depends_on :fortran` instead of `ENV.fortran`", + severity: :convention, + line: 5, + column: 4, + 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]) |
