Module: RuboCop::FactoryBot::Language

Overview

Contains node matchers for common factory_bot DSL.

Constant Summary collapse

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

Instance Method Summary collapse

Instance Method Details

#factory_bot?(node) ⇒ Object



30
31
32
# File 'lib/rubocop/factory_bot/language.rb', line 30

def_node_matcher :factory_bot?, <<~PATTERN
  (const {nil? cbase} {:FactoryGirl :FactoryBot})
PATTERN