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_inside_block?, #skipped_in_metadata?
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language::NodePattern
#block_or_numblock_pattern, #block_pattern, #numblock_pattern, #send_pattern
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_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
49 50 51 52 53 54 |
# File 'lib/rubocop/cop/rspec/pending.rb', line 49 def_node_matcher :pending_block?, <<~PATTERN { (send #rspec? #ExampleGroups.skipped ...) (send nil? {#Examples.skipped #Examples.pending} ...) } PATTERN |
#skippable?(node) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/rubocop/cop/rspec/pending.rb', line 41 def_node_matcher :skippable?, <<~PATTERN { (send #rspec? #ExampleGroups.regular ...) (send nil? #Examples.regular ...) } PATTERN |