Module: FactoryGirl

Defined in:
lib/factory_scenarios/engine.rb

Class Method Summary collapse

Class Method Details

.register_factory(factory, options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/factory_scenarios/engine.rb', line 12

def self.register_factory(factory, options = {})
  self.factories.class.class_eval {
    def add_forced(item)
      @items[item.name.to_sym] = item
    end
  }

  self.factories.add_forced(factory)
end

.register_sequence(sequence, options = {}) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/factory_scenarios/engine.rb', line 22

def self.register_sequence(sequence, options = {})
  self.sequences.class.class_eval {
    def add_forced(item)
      @items[item.name.to_sym] = item
    end
  }

  self.sequences.add_forced(sequence)
end