Class: RuboCop::Cop::RSpec::AroundBlock
- Defined in:
- lib/rubocop/cop/rspec/around_block.rb
Overview
Checks that around blocks actually run the test.
Constant Summary collapse
- MSG_NO_ARG =
'Test object should be passed to around block.'
- MSG_UNUSED_ARG =
'You should call `%<arg>s.call` '\ 'or `%<arg>s.run`.'
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
41 42 43 44 45 46 47 48 49 |
# File 'lib/rubocop/cop/rspec/around_block.rb', line 41 def on_block(node) hook(node) do |(example_proxy)| if example_proxy.nil? add_no_arg_offense(node) else check_for_unused_proxy(node, example_proxy) end end end |