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

Inherits:
Base
  • Object
show all
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, BeEmpty, BeEq, BeEql, BeNil, BeforeAfterAll, ChangeByZero, ClassCheck, ContainExactly, ContextMethod, ContextWording, DescribeClass, DescribeMethod, DescribeSymbol, DescribedClass, DescribedClassModuleWrapping, Dialect, DuplicatedMetadata, EmptyExampleGroup, EmptyHook, EmptyLineAfterExample, EmptyLineAfterExampleGroup, EmptyLineAfterFinalLet, EmptyLineAfterHook, EmptyLineAfterSubject, EmptyMetadata, EmptyOutput, Eq, ExampleLength, ExampleWithoutDescription, ExampleWording, ExcessiveDocstringSpacing, ExpectActual, ExpectChange, ExpectInHook, ExpectInLet, ExpectOutput, Focus, HookArgument, HooksBeforeExamples, IdenticalEqualityAssertion, ImplicitBlockExpectation, ImplicitExpect, ImplicitSubject, IndexedLet, InstanceSpy, InstanceVariable, IsExpectedSpecify, ItBehavesLike, IteratedExpectation, LeadingSubject, LeakyConstantDeclaration, LetBeforeExamples, LetSetup, MatchArray, MessageChain, MessageExpectation, MessageSpies, MetadataStyle, MissingExampleGroupArgument, MissingExpectationTargetMethod, MultipleDescribes, MultipleExpectations, MultipleMemoizedHelpers, MultipleSubjects, NamedSubject, NestedGroups, NoExpectationExample, NotToNot, OverwritingSetup, Pending, PendingWithoutReason, PredicateMatcher, ReceiveCounts, ReceiveMessages, ReceiveNever, RedundantAround, RedundantPredicateMatcher, RemoveConst, RepeatedDescription, RepeatedExample, RepeatedExampleGroupBody, RepeatedExampleGroupDescription, RepeatedIncludeExample, RepeatedSubjectCall, ReturnFromStub, ScatteredLet, ScatteredSetup, SharedContext, SharedExamples, SingleArgumentMessageChain, SkipBlockInsideExample, SortMetadata, SpecFilePathFormat, SpecFilePathSuffix, StringAsInstanceDoubleConstant, StubbedMock, SubjectDeclaration, SubjectStub, UndescriptiveLiteralsDescription, UnspecifiedException, VariableDefinition, VariableName, VerifiedDoubleReference, VerifiedDoubles, VoidExpect, Yield

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RSpec::Language

#example?, #example_group?, #example_group_with_body?, #explicit_rspec?, #hook?, #include?, #let?, #rspec?, #shared_group?, #spec_group?, #subject?

Class Method Details

.inherited(subclass) ⇒ Object

Invoke the original inherited hook so our cops are recognized



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

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.



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

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