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.'
Constants inherited from Cop
Cop::DEFAULT_CONFIGURATION, Cop::DEFAULT_PATTERN_RE
Constants included from RSpec::Language
RSpec::Language::ALL, RSpec::Language::RSPEC
Instance Method Summary collapse
Methods inherited from Cop
Instance Method Details
#on_block(node) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/rubocop/cop/rspec/let_setup.rb', line 37 def on_block(node) return unless example_group?(node) unused_let_bang(node) do |let| add_offense(let) end end |