Class: FactoryBot::Decorator::DisallowsDuplicatesRegistry
- Inherits:
-
Decorator
- Object
- Decorator
- FactoryBot::Decorator::DisallowsDuplicatesRegistry
- Defined in:
- lib/factory_bot/decorator/disallows_duplicates_registry.rb
Instance Method Summary collapse
Instance Method Details
#register(name, item) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/factory_bot/decorator/disallows_duplicates_registry.rb', line 4 def register(name, item) if registered?(name) raise DuplicateDefinitionError, "#{@component.name} already registered: #{name}" else @component.register(name, item) end end |