class Nucop::ShadowingFactoryBotCreationMethods

This cop looks for defined methods in spec files that would shadow methods defined in FactoryBot::Syntax::Methods. See FactoryBotHelper::FACTORY_BOT_METHODS constant for a complete list.

@example

# bad

def create(args)
  ...
end

# good

def create_transfer_pallet(args)
  ...
end

Constants

MSG

Public Instance Methods

on_def(node) click to toggle source
# File lib/nucop/cops/shadowing_factory_bot_creation_methods.rb, line 27
def on_def(node)
  factory_bot_methods(node) do |method|
    add_offense(node, location: :expression, message: format(MSG, method: method))
  end
end
relevant_file?(file) click to toggle source
Calls superclass method
# File lib/nucop/cops/shadowing_factory_bot_creation_methods.rb, line 33
def relevant_file?(file)
  acceptance_or_spec_file?(file) && super
end