Sha256: 5f2d4952b4c7d08e249c2f4c210ec16d64fb9a620b397e7b4072e66e7655e43b

Contents?: true

Size: 488 Bytes

Versions: 48

Compression:

Stored size: 488 Bytes

Contents

# frozen_string_literal: true

module RailsAppGenerator
  # Custom add-ons for RailsAppGenerator
  module AddOns
    # Add FactoryBot to rails application
    class FactoryBot < RailsAppGenerator::Addon
      depends_on :active_record, :test

      # Requires Testing
      def apply
        # TODO: Make this work for minitest
        return unless uses?(:factory_bot)

        empty_directory 'spec/factories'
        template('spec/support/factory_bot.rb')
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
rails_app_generator-0.2.10 lib/rails_app_generator/addons/factory_bot.rb
rails_app_generator-0.2.9 lib/rails_app_generator/addons/factory_bot.rb
rails_app_generator-0.2.8 lib/rails_app_generator/addons/factory_bot.rb
rails_app_generator-0.2.7 lib/rails_app_generator/addons/factory_bot.rb
rails_app_generator-0.2.6 lib/rails_app_generator/addons/factory_bot.rb
rails_app_generator-0.2.5 lib/rails_app_generator/addons/factory_bot.rb
rails_app_generator-0.2.4 lib/rails_app_generator/addons/factory_bot.rb
rails_app_generator-0.2.3 lib/rails_app_generator/addons/factory_bot.rb