mirror of
https://github.com/gosticks/brew.git
synced 2026-10-06 07:26:56 +00:00
class_cop_spec: add tests for tighter test audit
This commit is contained in:
@@ -59,4 +59,29 @@ describe RuboCop::Cop::FormulaAuditStrict::Test do
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
|
||||
it "reports an offense when there is an empty test block" do
|
||||
expect_offense(<<~RUBY)
|
||||
class Foo < Formula
|
||||
url 'https://example.com/foo-1.0.tgz'
|
||||
|
||||
test do
|
||||
^^^^^^^ `test do` should not be empty
|
||||
end
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
|
||||
it "reports an offense when test is falsely true" do
|
||||
expect_offense(<<~RUBY)
|
||||
class Foo < Formula
|
||||
url 'https://example.com/foo-1.0.tgz'
|
||||
|
||||
test do
|
||||
^^^^^^^ `test do` should contain a real test
|
||||
true
|
||||
end
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user