Module: RuboCop::RSpec::FactoryBot::Language

Extended by:
NodePattern::Macros
Included in:
Cop::RSpec::FactoryBot::ConsistentParenthesesStyle, Cop::RSpec::FactoryBot::CreateList, Cop::RSpec::FactoryBot::FactoryNameStyle, Cop::RSpec::FactoryBot::SyntaxMethods
Defined in:
lib/rubocop/rspec/factory_bot/language.rb

Overview

Contains node matchers for common FactoryBot 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



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

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