Class: RuboCop::Cop::RSpec::Focus

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

Overview

Checks if examples are focused.

Examples:

# bad
describe MyClass, focus: true do
end

describe MyClass, :focus do
end

fdescribe MyClass do
end

# good
describe MyClass do
end

Constant Summary collapse

MSG =
'Focused 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



45
46
47
48
49
# File 'lib/rubocop/cop/rspec/focus.rb', line 45

def on_send(node)
  (node) do |focus|
    add_offense(focus)
  end
end