Class: RuboCop::Cop::RSpec::Cop Abstract
- Inherits:
-
WorkaroundCop
- Object
- WorkaroundCop
- RuboCop::Cop::RSpec::Cop
- Includes:
- RSpec::Language, RSpec::Language::NodePattern
- Defined in:
- lib/rubocop/cop/rspec/cop.rb
Overview
parent class to rspec cops
The criteria for whether rubocop-rspec analyzes a certain ruby file is configured via ‘AllCops/RSpec`. For example, if you want to customize your project to scan all files within a `test/` directory then you could add this to your configuration:
Direct Known Subclasses
AlignLeftLetBrace, AlignRightLetBrace, AnyInstance, AroundBlock, BeEql, BeforeAfterAll, RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation, RuboCop::Cop::RSpec::Capybara::FeatureMethods, ContextWording, DescribeClass, DescribeMethod, DescribeSymbol, DescribedClass, EmptyExampleGroup, EmptyLineAfterFinalLet, EmptyLineAfterSubject, ExampleLength, ExampleWithoutDescription, ExampleWording, ExpectActual, ExpectChange, ExpectInHook, ExpectOutput, FactoryBot::DynamicAttributeDefinedStatically, FactoryBot::StaticAttributeDefinedDynamically, FilePath, Focus, HookArgument, ImplicitExpect, InstanceSpy, InstanceVariable, InvalidPredicateMatcher, ItBehavesLike, IteratedExpectation, LeadingSubject, LetBeforeExamples, LetSetup, MessageChain, MessageExpectation, MessageSpies, MultipleDescribes, MultipleExpectations, MultipleSubjects, NamedSubject, NestedGroups, NotToNot, OverwritingSetup, PredicateMatcher, Rails::HttpStatus, RepeatedDescription, RepeatedExample, ReturnFromStub, ScatteredLet, ScatteredSetup, SharedContext, SingleArgumentMessageChain, SubjectStub, VerifiedDoubles, VoidExpect
Constant Summary collapse
- DEFAULT_CONFIGURATION =
RuboCop::RSpec::CONFIG.fetch('AllCops').fetch('RSpec')
- DEFAULT_PATTERN_RE =
Regexp.union( DEFAULT_CONFIGURATION.fetch('Patterns') .map(&Regexp.public_method(:new)) )
Constants included from RSpec::Language
Class Method Summary collapse
-
.inherited(subclass) ⇒ Object
Invoke the original inherited hook so our cops are recognized.
Instance Method Summary collapse
Class Method Details
Instance Method Details
#relevant_file?(file) ⇒ Boolean
57 58 59 |
# File 'lib/rubocop/cop/rspec/cop.rb', line 57 def relevant_file?(file) relevant_rubocop_rspec_file?(file) && super end |