Class: RuboCop::Cop::Sevencop::RSpecPendingOnlyExampleGroup

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/sevencop/rspec_pending_only_example_group.rb

Overview

Remove pending-only test files.

Examples:

# bad
RSpec.describe Post do
  pending "add some examples to (or delete) #{__FILE__}"
end

Constant Summary collapse

MSG =
'Remove pending-only test files.'
RESTRICT_ON_SEND =
i[
  describe
].freeze

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object Also known as: on_csend



20
21
22
23
24
25
# File 'lib/rubocop/cop/sevencop/rspec_pending_only_example_group.rb', line 20

def on_send(node)
  block_node = node.parent
  return unless pending_only_example_group?(block_node)

  add_offense(block_node)
end