Class: RuboCop::Cop::RSpec::InvalidPredicateMatcher
- Defined in:
- lib/rubocop/cop/rspec/invalid_predicate_matcher.rb
Overview
Checks invalid usage for predicate matcher.
Predicate matcher does not need a question. This cop checks an unnecessary question in predicate matcher.
Constant Summary collapse
- MSG =
'Omit `?` from `%<matcher>s`.'.freeze
Constants inherited from Cop
Cop::DEFAULT_CONFIGURATION, Cop::DEFAULT_PATTERN_RE
Constants included from RSpec::Language
Instance Method Summary collapse
Methods inherited from Cop
Instance Method Details
#on_send(node) ⇒ Object
23 24 25 26 27 |
# File 'lib/rubocop/cop/rspec/invalid_predicate_matcher.rb', line 23 def on_send(node) invalid_predicate_matcher?(node) do |predicate| add_offense(predicate, location: :expression) end end |