Class: RuboCop::Cop::RSpec::LetSetup
- Includes:
- RSpec::TopLevelDescribe
- 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!` for test setup.'.freeze
Constants inherited from Cop
Cop::DEFAULT_CONFIGURATION, Cop::DEFAULT_PATTERN_RE
Constants included from RSpec::Language
Instance Method Summary collapse
Methods included from RSpec::TopLevelDescribe
Methods inherited from Cop
Instance Method Details
#on_block(node) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/rubocop/cop/rspec/let_setup.rb', line 39 def on_block(node) return unless example_group?(node) unused_let_bang(node) do |let| add_offense(let, location: :expression) end end |