# frozen_string_literal: true module RuboCop module Cop module RSpec # Checks for consistent verified double reference style. # # Only investigates references that are one of the supported styles. # # @see https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles # # This cop can be configured in your configuration using the # `EnforcedStyle` option and supports `--auto-gen-config`. # # @example `EnforcedStyle: constant` (default) # # bad # let(:foo) do # instance_double('ClassName', method_name: 'returned_value') # end # # # good # let(:foo) do # instance_double(ClassName, method_name: 'returned_value') # end # # @example `EnforcedStyle: string` # # bad # let(:foo) do # instance_double(ClassName, method_name: 'returned_value') # end # # # good # let(:foo) do # instance_double('ClassName', method_name: 'returned_value') # end # # @example Reference is not in the supported style list. No enforcement # # # good # let(:foo) do # instance_double(@klass, method_name: 'returned_value') # end class VerifiedDoubleReference < Base extend AutoCorrector include ConfigurableEnforcedStyle MSG = 'Use a %