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, BeEmpty, BeEq, BeEql, BeNil, BeforeAfterAll, Capybara::FeatureMethods, 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, ExpectOutput, FilePath, Focus, HookArgument, HooksBeforeExamples, IdenticalEqualityAssertion, ImplicitBlockExpectation, ImplicitExpect, ImplicitSubject, IndexedLet, InstanceSpy, InstanceVariable, IsExpectedSpecify, ItBehavesLike, IteratedExpectation, LeadingSubject, LeakyConstantDeclaration, LetBeforeExamples, LetSetup, MatchArray, MessageChain, MessageExpectation, MessageSpies, MetadataStyle, MissingExampleGroupArgument, MultipleDescribes, MultipleExpectations, MultipleMemoizedHelpers, MultipleSubjects, NamedSubject, NestedGroups, NoExpectationExample, NotToNot, OverwritingSetup, Pending, PendingWithoutReason, PredicateMatcher, Rails::AvoidSetupHook, Rails::HttpStatus, Rails::InferredSpecType, Rails::MinitestAssertions, Rails::NegationBeValid, Rails::TravelAround, ReceiveCounts, ReceiveMessages, ReceiveNever, RedundantAround, RedundantPredicateMatcher, RemoveConst, RepeatedDescription, RepeatedExample, RepeatedExampleGroupBody, RepeatedExampleGroupDescription, RepeatedIncludeExample, RepeatedSubjectCall, ReturnFromStub, ScatteredLet, ScatteredSetup, SharedContext, SharedExamples, SingleArgumentMessageChain, SkipBlockInsideExample, SortMetadata, SpecFilePathFormat, SpecFilePathSuffix, StubbedMock, SubjectDeclaration, SubjectStub, UndescriptiveLiteralsDescription, UnspecifiedException, VariableDefinition, VariableName, VerifiedDoubleReference, VerifiedDoubles, VoidExpect, Yield

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RSpec::Language::NodePattern

block_or_numblock_pattern, block_pattern, numblock_pattern, send_pattern

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



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