Sha256: b723c712dee01524d9d6a95ab0890676ef758e9f27c1143aaa35db197350552e

Contents?: true

Size: 418 Bytes

Versions: 109

Compression:

Stored size: 418 Bytes

Contents

module FactoryGirl
  class DisallowsDuplicatesRegistry
    def initialize(component)
      @component = component
    end

    delegate :clear, :each, :find, :[], :registered?, to: :@component

    def register(name, item)
      if registered?(name)
        raise DuplicateDefinitionError, "#{@component.name} already registered: #{name}"
      else
        @component.register(name, item)
      end
    end
  end
end

Version data entries

109 entries across 58 versions & 5 rubygems

Version Path
classiccms-0.6.5 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.5 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.4 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.4 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.3 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.3 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.2 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.2 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.1 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.1 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.0 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.0 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.5.17 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.5.17 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.5.16 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.5.16 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.5.15 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.5.15 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.5.14 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.5.14 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb