Class: RuboCop::Cop::RSpec::EmptyExampleGroup
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::RSpec::EmptyExampleGroup
- Defined in:
- lib/rubocop/cop/rspec/empty_example_group.rb
Overview
Checks if an example group does not include any tests.
This cop is configurable using the ‘CustomIncludeMethods` option
Constant Summary collapse
- MSG =
'Empty example group detected.'.freeze
Constants included from RSpec::SpecOnly
RSpec::SpecOnly::DEFAULT_CONFIGURATION
Constants included from RSpec::Language
Instance Method Summary collapse
Methods included from RSpec::SpecOnly
Instance Method Details
#on_block(node) ⇒ Object
80 81 82 83 84 |
# File 'lib/rubocop/cop/rspec/empty_example_group.rb', line 80 def on_block(node) return unless example_group?(node) && !contains_example?(node) add_offense(node.children.first, :expression) end |