Sha256: 2381230c1cdd7088153e74b4a52e36c8600c6df4f9358a12fd2dca9dca3f19dd

Contents?: true

Size: 830 Bytes

Versions: 12

Compression:

Stored size: 830 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module RSpec
    module FactoryBot
      # Contains node matchers for common FactoryBot DSL.
      module Language
        extend RuboCop::NodePattern::Macros

        METHODS = %i[
          attributes_for
          attributes_for_list
          attributes_for_pair
          build
          build_list
          build_pair
          build_stubbed
          build_stubbed_list
          build_stubbed_pair
          create
          create_list
          create_pair
          generate
          generate_list
          null
          null_list
          null_pair
        ].to_set.freeze

        # @!method factory_bot?(node)
        def_node_matcher :factory_bot?, <<~PATTERN
          (const {nil? cbase} {:FactoryGirl :FactoryBot})
        PATTERN
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rubocop-rspec-2.21.0 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.20.0 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.19.0 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.18.1 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.18.0 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.17.1 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.17.0 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.16.0 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.15.0 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.14.2 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.14.1 lib/rubocop/rspec/factory_bot/language.rb
rubocop-rspec-2.14.0 lib/rubocop/rspec/factory_bot/language.rb