Sha256: c1a34f7441dfe64127c1283a2eab70371ce9d3cd31c6a5242e201078cbabf364

Contents?: true

Size: 1.92 KB

Versions: 5

Compression:

Stored size: 1.92 KB

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module RSpec
      module Rails
        # @!parse
        #   # Identifies redundant spec type.
        #   #
        #   # After setting up rspec-rails, you will have enabled
        #   # `config.infer_spec_type_from_file_location!` by default in
        #   # spec/rails_helper.rb. This cop works in conjunction with
        #   # this config.
        #   # If you disable this config, disable this cop as well.
        #   #
        #   # @safety
        #   #   This cop is marked as unsafe because
        #   #   `config.infer_spec_type_from_file_location!` may not be enabled.
        #   #
        #   # @example
        #   #   # bad
        #   #   # spec/models/user_spec.rb
        #   #   RSpec.describe User, type: :model do
        #   #   end
        #   #
        #   #   # good
        #   #   # spec/models/user_spec.rb
        #   #   RSpec.describe User do
        #   #   end
        #   #
        #   #   # good
        #   #   # spec/models/user_spec.rb
        #   #   RSpec.describe User, type: :common do
        #   #   end
        #   #
        #   # @example `Inferences` configuration
        #   #   # .rubocop.yml
        #   #   # RSpec/Rails/InferredSpecType:
        #   #   #   Inferences:
        #   #   #     services: service
        #   #
        #   #   # bad
        #   #   # spec/services/user_spec.rb
        #   #   RSpec.describe User, type: :service do
        #   #   end
        #   #
        #   #   # good
        #   #   # spec/services/user_spec.rb
        #   #   RSpec.describe User do
        #   #   end
        #   #
        #   #   # good
        #   #   # spec/services/user_spec.rb
        #   #   RSpec.describe User, type: :common do
        #   #   end
        #   #
        #   class InferredSpecType < RuboCop::Cop::RSpec::Base; end
        InferredSpecType = ::RuboCop::Cop::RSpecRails::InferredSpecType
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubocop-rspec-2.31.0 lib/rubocop/cop/rspec/rails/inferred_spec_type.rb
rubocop-rspec-2.30.0 lib/rubocop/cop/rspec/rails/inferred_spec_type.rb
rubocop-rspec-2.29.2 lib/rubocop/cop/rspec/rails/inferred_spec_type.rb
rubocop-rspec-2.29.1 lib/rubocop/cop/rspec/rails/inferred_spec_type.rb
rubocop-rspec-2.29.0 lib/rubocop/cop/rspec/rails/inferred_spec_type.rb