Class: Gitlab::Styles::Rubocop::Cop::RSpec::EmptyLineAfterSharedExample
- Inherits:
-
RuboCop::Cop::RSpec::Cop
- Object
- RuboCop::Cop::RSpec::Cop
- Gitlab::Styles::Rubocop::Cop::RSpec::EmptyLineAfterSharedExample
- Includes:
- RuboCop::RSpec::BlankLineSeparation
- Defined in:
- lib/gitlab/styles/rubocop/cop/rspec/empty_line_after_shared_example.rb
Overview
Checks if there is an empty line after shared example blocks.
Constant Summary collapse
- MSG =
'Add an empty line after `%<example>s` block.'
Instance Method Summary collapse
Instance Method Details
#on_block(node) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/gitlab/styles/rubocop/cop/rspec/empty_line_after_shared_example.rb', line 49 def on_block(node) shared_examples(node) do break if last_child?(node) (node) do |location| add_offense(node, location: location, message: format(MSG, example: node.method_name)) end end end |