Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Consolidate errors into factory.rb

  • Loading branch information...
commit c46c090bdcf7730826c7c03a370297bb4c0146e0 1 parent 9472a14
Joshua Clayton joshuaclayton authored
9 lib/factory_girl.rb
View
@@ -34,6 +34,15 @@ class InvalidCallbackNameError < RuntimeError; end
# 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
6 lib/factory_girl/attribute.rb
View
@@ -4,12 +4,6 @@
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
3  lib/factory_girl/sequence.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.