aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/rubocops/patches_cop_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/rubocops/patches_cop_spec.rb')
-rw-r--r--Library/Homebrew/test/rubocops/patches_cop_spec.rb66
1 files changed, 48 insertions, 18 deletions
diff --git a/Library/Homebrew/test/rubocops/patches_cop_spec.rb b/Library/Homebrew/test/rubocops/patches_cop_spec.rb
index 4bd79bf35..092782bfb 100644
--- a/Library/Homebrew/test/rubocops/patches_cop_spec.rb
+++ b/Library/Homebrew/test/rubocops/patches_cop_spec.rb
@@ -62,34 +62,48 @@ describe RuboCop::Cop::FormulaAudit::Patches do
inspect_source(cop, source)
if patch_url =~ %r{/raw\.github\.com/}
- expected_offenses = [{ message: "GitHub/Gist patches should specify a revision:\n#{patch_url}",
+ expected_offenses = [{ message: <<-EOS.undent.chomp,
+ GitHub/Gist patches should specify a revision:
+ #{patch_url}
+ EOS
severity: :convention,
line: 5,
column: 12,
source: source }]
elsif patch_url =~ %r{macports/trunk}
- expected_offenses = [{ message: "MacPorts patches should specify a revision instead of trunk:\n#{patch_url}",
+ expected_offenses = [{ message: <<-EOS.undent.chomp,
+ MacPorts patches should specify a revision instead of trunk:
+ #{patch_url}
+ EOS
severity: :convention,
line: 5,
column: 33,
source: source }]
elsif patch_url =~ %r{^http://trac\.macports\.org}
- expected_offenses = [{ message: "Patches from MacPorts Trac should be https://, not http:\n#{patch_url}",
+ expected_offenses = [{ message: <<-EOS.undent.chomp,
+ Patches from MacPorts Trac should be https://, not http:
+ #{patch_url}
+ EOS
severity: :convention,
line: 5,
column: 5,
source: source }]
elsif patch_url =~ %r{^http://bugs\.debian\.org}
- expected_offenses = [{ message: "Patches from Debian should be https://, not http:\n#{patch_url}",
+ expected_offenses = [{ message: <<-EOS.undent.chomp,
+ Patches from Debian should be https://, not http:
+ #{patch_url}
+ EOS
severity: :convention,
line: 5,
column: 5,
source: source }]
elsif patch_url =~ %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}
- expected_offenses = [{ message: "use GitHub pull request URLs:\n"\
- " https://github.com/foo/foo-bar/pull/100.patch\n"\
- "Rather than patch-diff:\n"\
- " https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch\n",
+ expected_offenses = [{ message: <<-EOS.undent,
+ use GitHub pull request URLs:
+ https://github.com/foo/foo-bar/pull/100.patch
+ Rather than patch-diff:
+ https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch
+ EOS
severity: :convention,
line: 5,
column: 5,
@@ -121,8 +135,10 @@ describe RuboCop::Cop::FormulaAudit::Patches do
line: 4,
column: 2,
source: source },
- { message: "Patches from MacPorts Trac should be https://, not http:\n"\
- "http://trac.macports.org/export/68507/trunk/dports/net/trafshow/files/",
+ { message: <<-EOS.undent.chomp,
+ Patches from MacPorts Trac should be https://, not http:
+ http://trac.macports.org/export/68507/trunk/dports/net/trafshow/files/
+ EOS
severity: :convention,
line: 8,
column: 26,
@@ -159,34 +175,48 @@ describe RuboCop::Cop::FormulaAudit::Patches do
inspect_source(cop, source)
if patch_url =~ %r{/raw\.github\.com/}
- expected_offenses = [{ message: "GitHub/Gist patches should specify a revision:\n#{patch_url}",
+ expected_offenses = [{ message: <<-EOS.undent.chomp,
+ GitHub/Gist patches should specify a revision:
+ #{patch_url}
+ EOS
severity: :convention,
line: 5,
column: 16,
source: source }]
elsif patch_url =~ %r{macports/trunk}
- expected_offenses = [{ message: "MacPorts patches should specify a revision instead of trunk:\n#{patch_url}",
+ expected_offenses = [{ message: <<-EOS.undent.chomp,
+ MacPorts patches should specify a revision instead of trunk:
+ #{patch_url}
+ EOS
severity: :convention,
line: 5,
column: 37,
source: source }]
elsif patch_url =~ %r{^http://trac\.macports\.org}
- expected_offenses = [{ message: "Patches from MacPorts Trac should be https://, not http:\n#{patch_url}",
+ expected_offenses = [{ message: <<-EOS.undent.chomp,
+ Patches from MacPorts Trac should be https://, not http:
+ #{patch_url}
+ EOS
severity: :convention,
line: 5,
column: 9,
source: source }]
elsif patch_url =~ %r{^http://bugs\.debian\.org}
- expected_offenses = [{ message: "Patches from Debian should be https://, not http:\n#{patch_url}",
+ expected_offenses = [{ message: <<-EOS.undent.chomp,
+ Patches from Debian should be https://, not http:
+ #{patch_url}
+ EOS
severity: :convention,
line: 5,
column: 9,
source: source }]
elsif patch_url =~ %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}
- expected_offenses = [{ message: "use GitHub pull request URLs:\n"\
- " https://github.com/foo/foo-bar/pull/100.patch\n"\
- "Rather than patch-diff:\n"\
- " https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch\n",
+ expected_offenses = [{ message: <<-EOS.undent,
+ use GitHub pull request URLs:
+ https://github.com/foo/foo-bar/pull/100.patch
+ Rather than patch-diff:
+ https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch
+ EOS
severity: :convention,
line: 5,
column: 9,