Skip to content

Commit 9e7ca20

Browse files
committed
Suppress RuboCop offense
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 ```
1 parent 316a78c commit 9e7ca20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/project_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
start_with_subject = description.match(/\AThis cop (?<verb>.+?) .*/)
2525
suggestion = start_with_subject[:verb]&.capitalize if start_with_subject
2626
suggestion ||= 'a verb'
27-
expect(start_with_subject).to(
28-
be_nil, "`Description` for `#{name}` should be started with `#{suggestion}` instead of `This cop ...`."
27+
expect(start_with_subject.nil?).to(
28+
be(true), "`Description` for `#{name}` should be started with `#{suggestion}` instead of `This cop ...`."
2929
)
3030
end
3131
end

0 commit comments

Comments
 (0)