Merge pull request #14084 from issyl0/test-for-formula-desc-ending-with-etc-dot
This commit is contained in:
commit
3692850bfd
@ -118,12 +118,28 @@ describe RuboCop::Cop::FormulaAudit::Desc do
|
|||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
|
|
||||||
it "reports an offense when the description ends with a full stop" do
|
it "report and corrects an offense when the description ends with a full stop" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'https://brew.sh/foo-1.0.tgz'
|
url 'https://brew.sh/foo-1.0.tgz'
|
||||||
desc 'Description with a full stop at the end.'
|
desc 'Description with a full stop at the end.'
|
||||||
^ Description shouldn\'t end with a full stop.
|
^ Description shouldn't end with a full stop.
|
||||||
|
end
|
||||||
|
RUBY
|
||||||
|
|
||||||
|
expect_correction(<<~RUBY)
|
||||||
|
class Foo < Formula
|
||||||
|
url 'https://brew.sh/foo-1.0.tgz'
|
||||||
|
desc 'Description with a full stop at the end'
|
||||||
|
end
|
||||||
|
RUBY
|
||||||
|
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
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user