lib/rubocop/cop/rspec/cop.rb in rubocop-rspec-1.39.0 vs lib/rubocop/cop/rspec/cop.rb in rubocop-rspec-1.40.0

- old
+ new

@@ -1,44 +1,24 @@ # frozen_string_literal: true module RuboCop module Cop - WorkaroundCop = Cop.dup - - # Clone of the the normal RuboCop::Cop::Cop class so we can rewrite - # the inherited method without breaking functionality - class WorkaroundCop - # Remove the Cop.inherited method to be a noop. Our RSpec::Cop - # class will invoke the inherited hook instead - class << self - undef inherited - def inherited(*) end - end - - # Special case `Module#<` so that the rspec support rubocop exports - # is compatible with our subclass - def self.<(other) - other.equal?(RuboCop::Cop::Cop) || super - end - end - private_constant(:WorkaroundCop) - module RSpec - # @abstract parent class to rspec cops + # @abstract 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: # # @example configuring analyzed paths - # - # AllCops: - # RSpec: - # Patterns: - # - '_test.rb$' - # - '(?:^|/)test/' - class Cop < WorkaroundCop + # # .rubocop.yml + # # AllCops: + # # RSpec: + # # Patterns: + # # - '_test.rb$' + # # - '(?:^|/)test/' + class Cop < ::RuboCop::Cop::Cop include RuboCop::RSpec::Language include RuboCop::RSpec::Language::NodePattern DEFAULT_CONFIGURATION = RuboCop::RSpec::CONFIG.fetch('AllCops').fetch('RSpec')