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

Inherits:
Cop
  • 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.'
FOCUSABLE_SELECTORS =
focusable.node_pattern_union

Constants inherited from Cop

Cop::DEFAULT_CONFIGURATION, Cop::DEFAULT_PATTERN_RE

Constants included from RSpec::Language

RSpec::Language::ALL, RSpec::Language::RSPEC

Instance Method Summary collapse

Methods inherited from Cop

inherited, #relevant_file?

Instance Method Details

#on_send(node) ⇒ Object


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

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