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