Module: PryFactoryBot

Defined in:
lib/pry-factorybot.rb

Constant Summary collapse

DEFAULT_STRATEGIES_NAMES =

TODO FactoryBot::Internal::DEFAULT_STRATEGIESでとれるようになるかも?

[:build, :create, :attributes_for, :build_stubbed, :null].freeze
Commands =
Pry::CommandSet.new do
  DEFAULT_STRATEGIES_NAMES.each do |strategy|
    command "#{strategy}", "FactoryBot.#{strategy}" do
      FactoryBot.class_eval <<-EOS
        #{Readline::HISTORY.to_a.last.gsub(' ', '')}
      EOS
    end
  end
end