Class: RuboCop::Cop::RSpec::Pending

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/rspec/pending.rb

Overview

Checks for any pending or skipped examples.

Examples:

# bad
describe MyClass do
  it "should be true"
end

describe MyClass do
  it "should be true", skip: true do
    expect(1).to eq(2)
  end
end

describe MyClass do
  it "should be true" do
    pending
  end
end

describe MyClass do
  xit "should be true" do
  end
end

# good
describe MyClass do
end

Constant Summary collapse

MSG =
'Pending spec found.'

Instance Method Summary collapse

Methods inherited from Base

inherited, #on_new_investigation

Methods included from RSpec::Language::NodePattern

#block_pattern, #send_pattern

Instance Method Details

#on_send(node) ⇒ Object


60
61
62
63
64
# File 'lib/rubocop/cop/rspec/pending.rb', line 60

def on_send(node)
  return unless pending_block?(node) || skipped?(node)

  add_offense(node)
end