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.7.5 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.5 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.4 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.4 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.3 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.3 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.2 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.2 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.1 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.1 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.0 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.7.0 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.9 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.9 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.8 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.8 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.7 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.7 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.6 vendor/bundle/gems/factory_girl-3.2.0/lib/factory_girl/disallows_duplicates_registry.rb
classiccms-0.6.6 vendor/bundle/gems/factory_girl-3.3.0/lib/factory_girl/disallows_duplicates_registry.rb