Class: RuboCop::Cop::RSpec::SkipBlockInsideExample
- Defined in:
- lib/rubocop/cop/rspec/skip_block_inside_example.rb
Overview
Checks for passing a block to ‘skip` within examples.
Constant Summary collapse
- MSG =
"Don't pass a block to `skip` inside examples."
Instance Method Summary collapse
- #on_block(node) ⇒ Object (also: #on_numblock)
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language
#example?, #example_group?, #example_group_with_body?, #explicit_rspec?, #hook?, #include?, #let?, #rspec?, #shared_group?, #spec_group?, #subject?
Instance Method Details
#on_block(node) ⇒ Object Also known as: on_numblock
29 30 31 32 33 34 |
# File 'lib/rubocop/cop/rspec/skip_block_inside_example.rb', line 29 def on_block(node) return unless node.method?(:skip) return unless inside_example?(node) add_offense(node) end |