Class: RuboCop::Cop::RSpec::ScatteredLet
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/rspec/scattered_let.rb
Overview
Checks for let scattered across the example group.
Group lets together
Constant Summary collapse
- MSG =
'Group all let/let! blocks in the example group together.'
Instance Method Summary collapse
-
#on_block(node) ⇒ Object
rubocop:disable InternalAffairs/NumblockHandler.
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language
#example?, #example_group?, #example_group_with_body?, #explicit_rspec?, #hook?, #include?, #let?, #rspec?, #shared_group?, #spec_group?, #subject?
Instance Method Details
#on_block(node) ⇒ Object
rubocop:disable InternalAffairs/NumblockHandler
34 35 36 37 38 |
# File 'lib/rubocop/cop/rspec/scattered_let.rb', line 34 def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_group_with_body?(node) check_let_declarations(node.body) end |