Method: RuboCop::Cop::RSpec::ExpectInLet#on_block

Defined in:
lib/rubocop/cop/rspec/expect_in_let.rb

#on_block(node) ⇒ Object

rubocop:disable InternalAffairs/NumblockHandler

[View source]

25
26
27
28
29
30
31
32
# File 'lib/rubocop/cop/rspec/expect_in_let.rb', line 25

def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
  return unless let?(node)
  return if node.body.nil?

  expectation(node.body) do |expect|
    add_offense(expect.loc.selector, message: message(expect))
  end
end