class RuboCop::Cop::RSpec::PredicateMatcher


expect(foo.something?).to be_truthy
# good - the above code is rewritten to it by this cop
expect(foo).to be_something
# bad
@example Strict: false, EnforcedStyle: explicit
TEXT
bar
expect(foo.something?(<<~TEXT)).to be(true)
# good
TEXT
bar
.to be_something(<<~TEXT)
expect(foo)
# bad - no autocorrect
expect(foo.something?).to be(true)
# good - the above code is rewritten to it by this cop
expect(foo).to be_something
# bad
@example Strict: true, EnforcedStyle: explicit
expect(foo).to be_something
# good
expect(foo.something?).to be(true)
expect(foo.something?).to be_truthy
# bad
@example Strict: false, EnforcedStyle: inflected
expect(foo.something?).to be(true)
# also good - It checks “true” strictly.
expect(foo).to be_something
# good
expect(foo.something?).to be_truthy
# bad
@example Strict: true, EnforcedStyle: inflected (default)
predicate method directly.
This cop recommends to use the predicate matcher instead of using
RSpec defines magic matchers for predicate methods.
Prefer using predicate matcher over using predicate method directly.

def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler

rubocop:disable InternalAffairs/NumblockHandler
def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
  check_explicit(node) if style == :explicit
end

def on_send(node)

def on_send(node)
  case style
  when :inflected
    check_inflected(node)
  when :explicit
    check_explicit(node)
  else
    # :nocov:
    :noop
    # :nocov:
  end
end