Skip to content

Commit

Permalink
Suppress RuboCop offense
Browse files Browse the repository at this point in the history
This commit suppresses the following new RuboCop offense with RuboCop RSpec 3.0.2:

```console
$ bundle exec rake
(snip)

spec/project_spec.rb:27:9: C: [Correctable] RSpec/PredicateMatcher: Prefer using nil? over be_nil matcher.
        expect(start_with_subject).to( ...
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

294 files inspected, 1 offense detected, 1 offense autocorrectable
```
  • Loading branch information
koic committed Jul 3, 2024
1 parent 316a78c commit 9e7ca20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
start_with_subject = description.match(/\AThis cop (?<verb>.+?) .*/)
suggestion = start_with_subject[:verb]&.capitalize if start_with_subject
suggestion ||= 'a verb'
expect(start_with_subject).to(
be_nil, "`Description` for `#{name}` should be started with `#{suggestion}` instead of `This cop ...`."
expect(start_with_subject.nil?).to(
be(true), "`Description` for `#{name}` should be started with `#{suggestion}` instead of `This cop ...`."
)
end
end
Expand Down

0 comments on commit 9e7ca20

Please sign in to comment.