mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
Consolidate errors into factory.rb
This commit is contained in:
parent
9472a14467
commit
c46c090bdc
3 changed files with 9 additions and 9 deletions
|
@ -34,6 +34,15 @@ module FactoryGirl
|
|||
# Raised when a factory is defined with the same name as a previously-defined factory.
|
||||
class DuplicateDefinitionError < RuntimeError; end
|
||||
|
||||
# Raised when calling Factory.sequence from a dynamic attribute block
|
||||
class SequenceAbuseError < RuntimeError; end
|
||||
|
||||
# Raised when defining an invalid attribute:
|
||||
# * Defining an attribute which has a name ending in "="
|
||||
# * Defining an attribute with both a static and lazy value
|
||||
# * Defining an attribute twice in the same factory
|
||||
class AttributeDefinitionError < RuntimeError; end
|
||||
|
||||
def self.factories
|
||||
@factories ||= Registry.new("Factory")
|
||||
end
|
||||
|
|
|
@ -4,12 +4,6 @@ require "factory_girl/attribute/association"
|
|||
require "factory_girl/attribute/sequence"
|
||||
|
||||
module FactoryGirl
|
||||
# Raised when defining an invalid attribute:
|
||||
# * Defining an attribute which has a name ending in "="
|
||||
# * Defining an attribute with both a static and lazy value
|
||||
# * Defining an attribute twice in the same factory
|
||||
class AttributeDefinitionError < RuntimeError
|
||||
end
|
||||
|
||||
class Attribute #:nodoc:
|
||||
include Comparable
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
module FactoryGirl
|
||||
|
||||
# Raised when calling Factory.sequence from a dynamic attribute block
|
||||
class SequenceAbuseError < StandardError; end
|
||||
|
||||
# Sequences are defined using sequence within a FactoryGirl.define block.
|
||||
# Sequence values are generated using next.
|
||||
class Sequence
|
||||
|
|
Loading…
Reference in a new issue