Sha256: 1e1bf5b29079bae8c682d5a913c21b82c30fe1969012cb27eb3a50baa1e03855

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

# frozen_string_literal: true

require 'factory_bot'
require 'spree/testing_support/factory_bot'

module SolidusDevSupport
  module TestingSupport
    module Factories
      def self.load_for(*engines)
        paths = engines.flat_map do |engine|
          engine.root.glob('lib/*/testing_support/factories{,.rb}')
        end.map { |path| path.sub(/.rb\z/, '').to_s }

        FactoryBot.definition_file_paths = [
          Spree::TestingSupport::FactoryBot.definition_file_paths,
          paths,
        ].flatten

        FactoryBot.reload
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_dev_support-2.6.0 lib/solidus_dev_support/testing_support/factories.rb