Class: RuboCop::Cop::RSpec::Base Abstract

Inherits:
Base
  • Object
show all
Extended by:
RSpec::Language::NodePattern
Includes:
RSpec::Language
Defined in:
lib/rubocop/cop/rspec/base.rb

Overview

This class is abstract.

parent class to RSpec cops

Direct Known Subclasses

AlignLeftLetBrace, AlignRightLetBrace, AnyInstance, AroundBlock, Be, BeEql, BeforeAfterAll, Capybara::CurrentPathExpectation, Capybara::FeatureMethods, Capybara::VisibilityMatcher, ContextMethod, ContextWording, DescribeClass, DescribeMethod, DescribeSymbol, DescribedClass, DescribedClassModuleWrapping, Dialect, EmptyExampleGroup, EmptyHook, EmptyLineAfterExample, EmptyLineAfterExampleGroup, EmptyLineAfterFinalLet, EmptyLineAfterHook, EmptyLineAfterSubject, ExampleLength, ExampleWithoutDescription, ExampleWording, ExpectActual, ExpectChange, ExpectInHook, ExpectOutput, FactoryBot::AttributeDefinedStatically, FactoryBot::CreateList, FactoryBot::FactoryClassName, FilePath, Focus, HookArgument, HooksBeforeExamples, ImplicitBlockExpectation, ImplicitExpect, ImplicitSubject, InstanceSpy, InstanceVariable, ItBehavesLike, IteratedExpectation, LeadingSubject, LeakyConstantDeclaration, LetBeforeExamples, LetSetup, MessageChain, MessageExpectation, MessageSpies, MissingExampleGroupArgument, MultipleDescribes, MultipleExpectations, MultipleMemoizedHelpers, MultipleSubjects, NamedSubject, NestedGroups, NotToNot, OverwritingSetup, Pending, PredicateMatcher, Rails::HttpStatus, ReceiveCounts, ReceiveNever, RepeatedDescription, RepeatedExample, RepeatedExampleGroupBody, RepeatedExampleGroupDescription, RepeatedIncludeExample, ReturnFromStub, ScatteredLet, ScatteredSetup, SharedContext, SharedExamples, SingleArgumentMessageChain, StubbedMock, SubjectStub, UnspecifiedException, VariableDefinition, VariableName, VerifiedDoubles, VoidExpect, Yield

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RSpec::Language::NodePattern

block_pattern, send_pattern

Class Method Details

.inherited(subclass) ⇒ Object

Invoke the original inherited hook so our cops are recognized


14
15
16
# File 'lib/rubocop/cop/rspec/base.rb', line 14

def self.inherited(subclass) # rubocop:disable Lint/MissingSuper
  RuboCop::Cop::Base.inherited(subclass)
end

Instance Method Details

#on_new_investigationObject

Set the config for dynamic DSL configuration-aware helpers that have no other means of accessing the configuration.


20
21
22
23
# File 'lib/rubocop/cop/rspec/base.rb', line 20

def on_new_investigation
  super
  RuboCop::RSpec::Language.config = config['RSpec']['Language']
end