test/rubocops/formula_desc: Ensure that desc allows ending with etc.

- This was funny (and embarrassing), I was looking at my first contributions to
  Homebrew since someone asked me how long I'd been involved.
- Turns out that in 2017 I improved the formula description RuboCop rule to
  allow descriptions to end with `etc.` in
  https://github.com/Homebrew/brew/pull/3411. Apparently I didn't have time
  back then to write a test for it. So now I will remedy this 5 years later.
This commit is contained in:
Issy Long 2022-11-03 22:25:07 +00:00
parent 84caae3f8f
commit f3d43110b5
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -128,6 +128,15 @@ describe RuboCop::Cop::FormulaAudit::Desc do
RUBY RUBY
end end
it "does not report an offense when the description ends with 'etc.'" do
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/foo.rb")
class Foo < Formula
url 'https://brew.sh/foo-1.0.tgz'
desc 'Description of a thing and some more things and some more etc.'
end
RUBY
end
it "reports and corrects all rules for description text" do it "reports and corrects all rules for description text" do
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
class Foo < Formula class Foo < Formula