Sha256: a4d25b302265c45d4eea7808da69bd861ef92b0e0217fcd889990e25cd14e3de

Contents?: true

Size: 568 Bytes

Versions: 112

Compression:

Stored size: 568 Bytes

Contents

module FactoryGirl
  class FactoryRunner
    def initialize(name, strategy, traits_and_overrides)
      @name     = name
      @strategy = strategy

      @overrides = traits_and_overrides.extract_options!
      @traits    = traits_and_overrides
    end

    def run(strategy_override = nil, &block)
      strategy_override ||= @strategy
      factory = FactoryGirl.factory_by_name(@name)

      factory.compile

      if @traits.any?
        factory = factory.with_traits(@traits)
      end

      factory.run(strategy_override, @overrides, &block)
    end
  end
end

Version data entries

112 entries across 66 versions & 6 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.5 vendor/bundle/gems/factory_girl-3.0.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.4 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.4 vendor/bundle/gems/factory_girl-3.0.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.3 vendor/bundle/gems/factory_girl-3.0.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.3 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.2 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.2 vendor/bundle/gems/factory_girl-3.0.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.1 vendor/bundle/gems/factory_girl-3.0.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.1 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.0 vendor/bundle/gems/factory_girl-3.0.0/lib/factory_girl/factory_runner.rb
classiccms-0.7.0 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/factory_runner.rb
classiccms-0.6.9 vendor/bundle/gems/factory_girl-3.0.0/lib/factory_girl/factory_runner.rb
classiccms-0.6.9 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/factory_runner.rb
classiccms-0.6.8 vendor/bundle/gems/factory_girl-3.0.0/lib/factory_girl/factory_runner.rb
classiccms-0.6.8 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/factory_runner.rb
classiccms-0.6.7 vendor/bundle/gems/factory_girl-3.0.0/lib/factory_girl/factory_runner.rb
classiccms-0.6.7 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/factory_runner.rb
classiccms-0.6.6 vendor/bundle/gems/factory_girl-3.0.0/lib/factory_girl/factory_runner.rb
classiccms-0.6.6 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/factory_runner.rb