class RuboCop::Cop::RSpec::Cop
-
‘(?:^|/)test/’
- ‘_test.rb$’
Patterns:
RSpec:
AllCops:
@example configuring analyzed paths
then you could add this to your configuration:
customize your project to scan all files within a ‘test/` directory
is configured via `AllCops/RSpec`. For example, if you want to
The criteria for whether rubocop-rspec analyzes a certain ruby file
@abstract parent class to rspec cops
def self.inherited(subclass)
def self.inherited(subclass) RuboCop::Cop::Cop.inherited(subclass) end
def relevant_file?(file)
def relevant_file?(file) relevant_rubocop_rspec_file?(file) && super end
def relevant_rubocop_rspec_file?(file)
def relevant_rubocop_rspec_file?(file) rspec_pattern =~ file end
def rspec_pattern
def rspec_pattern Regexp.union(rspec_pattern_config.map(&Regexp.public_method(:new))) end
def rspec_pattern_config
def rspec_pattern_config config .for_all_cops .fetch('RSpec', DEFAULT_CONFIGURATION) .fetch('Patterns') end