Module: Journeyman::Load

Included in:
Journeyman
Defined in:
lib/journeyman/load.rb

Overview

Internal: Contains all the file requirement logic, to load the factory definitions.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#factories_pathsObject

Public: Paths that will be loaded expecting factory definitions.



7
8
9
# File 'lib/journeyman/load.rb', line 7

def factories_paths
  @factories_paths
end

Class Method Details

.extended(journeyman) ⇒ Object



9
10
11
# File 'lib/journeyman/load.rb', line 9

def self.extended(journeyman)
  journeyman.factories_paths = %w(spec/factories)
end

Instance Method Details

#load_factoriesObject

Internal: Loads all the factory files and processes the factory definitions.



14
15
16
17
18
19
# File 'lib/journeyman/load.rb', line 14

def load_factories
  absolute_factories_paths.each do |path|
    load_factories_if_file(path)
    load_factories_if_directory(path)
  end
end