Sha256: fa507424f38de09cc475e710389ab964761883dd4e295d594bf281b6f5d8fff9

Contents?: true

Size: 550 Bytes

Versions: 3

Compression:

Stored size: 550 Bytes

Contents

module FactoryGirlRails
  module Generators
    class RSpecGenerator
      def initialize(generators)
        @generators = generators
      end

      def run
        @generators.fixture_replacement fixture_replacement_setting, dir: factory_girl_directory
      end

      private

      def fixture_replacement_setting
        @generators.options[:rails][:fixture_replacement] || :factory_girl
      end

      def factory_girl_directory
        @generators.options.fetch(:factory_girl, { dir: 'spec/factories' })[:dir]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
factory_girl_rails-4.4.1 lib/factory_girl_rails/generators/rspec_generator.rb
factory_girl_rails-4.4.0 lib/factory_girl_rails/generators/rspec_generator.rb
factory_girl_rails-4.3.0 lib/factory_girl_rails/generators/rspec_generator.rb