Class: RuboCop::Cop::RSpec::LetSetup
- Defined in:
- lib/rubocop/cop/rspec/let_setup.rb
Overview
Checks unreferenced ‘let!` calls being used for test setup.
Constant Summary collapse
- MSG =
'Do not use `let!` to setup objects not referenced in tests.'
Instance Method Summary collapse
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language::NodePattern
Instance Method Details
#on_block(node) ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/rubocop/cop/rspec/let_setup.rb', line 49 def on_block(node) return unless example_or_shared_group_or_including?(node) unused_let_bang(node) do |let| add_offense(let) end end |