Class: RuboCop::Cop::RSpec::Pending
- Includes:
- SkipOrPending
- Defined in:
- lib/rubocop/cop/rspec/pending.rb
Overview
Checks for any pending or skipped examples.
Constant Summary collapse
- MSG =
'Pending spec found.'
Instance Method Summary collapse
Methods included from SkipOrPending
#skip_or_pending?, #skipped_in_metadata?
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language::NodePattern
#block_pattern, #numblock_pattern, #send_pattern
Methods included from RSpec::Language
#example?, #example_group?, #example_group_with_body?, #hook?, #include?, #let?, #rspec?, #shared_group?, #spec_group?, #subject?
Instance Method Details
#on_send(node) ⇒ Object
56 57 58 59 60 |
# File 'lib/rubocop/cop/rspec/pending.rb', line 56 def on_send(node) return unless pending_block?(node) || skipped?(node) add_offense(node) end |
#pending_block?(node) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/rubocop/cop/rspec/pending.rb', line 47 def_node_matcher :pending_block?, send_pattern(<<~PATTERN) { #ExampleGroups.skipped #Examples.skipped #Examples.pending } PATTERN |
#skippable?(node) ⇒ Object
41 42 43 44 |
# File 'lib/rubocop/cop/rspec/pending.rb', line 41 def_node_matcher :skippable?, send_pattern(<<~PATTERN) {#ExampleGroups.regular #Examples.regular} PATTERN |