Module: TestProf::FactoryProf::FabricationPatch

Defined in:
lib/test_prof/factory_prof/fabrication_patch.rb

Overview

Wrap #run method with FactoryProf tracking

Instance Method Summary collapse

Instance Method Details

#create(name, overrides = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/test_prof/factory_prof/fabrication_patch.rb', line 7

def create(name, overrides = {})
  variation = ""

  if FactoryProf.config.include_variations? && !overrides.empty?
    variation += overrides.keys.sort.to_s.gsub(/[\\":]/, "")
  end

  FactoryBuilders::Fabrication.track(name, variation: variation.to_sym) { super }
end