diff options
| author | Gautham Goli | 2017-05-13 18:44:37 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-05-13 18:48:40 +0530 |
| commit | 80572939b4ba691e6dc754e1151dd46ac5dcbca4 (patch) | |
| tree | 8d5e52e13a50ff7e9586e7aaf39bcaa86582002a /Library/Homebrew/test | |
| parent | 459fef3b09b25d3e24cce6aa6f2e3a7bd5460a2b (diff) | |
| download | brew-80572939b4ba691e6dc754e1151dd46ac5dcbca4.tar.bz2 | |
Update string_content method to support multiline strings, add test for same
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb index 581667935..432b15e3c 100644 --- a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb @@ -51,6 +51,31 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do end end + it "When desc is multiline string" do + source = <<-EOS.undent + class Foo < Formula + url 'http://example.com/foo-1.0.tgz' + desc '#{"bar"*10}'\ + '#{"foo"*21}' + end + EOS + + msg = <<-EOS.undent + Description is too long. "name: desc" should be less than 80 characters. + Length is calculated as Foo + desc. (currently 98) + EOS + expected_offenses = [{ message: msg, + severity: :convention, + line: 3, + column: 2, + source: source }] + + inspect_source(cop, source) + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + it "When wrong \"command-line\" usage in desc" do source = <<-EOS.undent class Foo < Formula |
