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 rubocop
(snip)

spec/project_spec.rb:25:9: C: [Correctable] RSpec/PredicateMatcher: Prefer using nil? over be_nil matcher.
        expect(start_with_subject).to( ...
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
  • Loading branch information
koic committed Jul 3, 2024
1 parent 7bd698c commit 745a392
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 @@ -22,8 +22,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 745a392

Please sign in to comment.