Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move errors to separate file

  • Loading branch information...
commit 98626c9c73e289ee6539f4ecf08325204ebde374 1 parent 6cddb37
Joshua Clayton joshuaclayton authored
Showing with 20 additions and 18 deletions.
  1. +1 −18 lib/factory_girl.rb
  2. +19 −0 lib/factory_girl/errors.rb
19 lib/factory_girl.rb
View
@@ -1,5 +1,6 @@
require "active_support/core_ext/module/delegation"
+require 'factory_girl/errors'
require 'factory_girl/proxy'
require 'factory_girl/registry'
require 'factory_girl/null_factory'
@@ -29,24 +30,6 @@
end
module FactoryGirl
- # Raised when a factory is defined that attempts to instantiate itself.
- class AssociationDefinitionError < RuntimeError; end
-
- # Raised when a callback is defined that has an invalid name
- 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
19 lib/factory_girl/errors.rb
View
@@ -0,0 +1,19 @@
+module FactoryGirl
+ # Raised when a factory is defined that attempts to instantiate itself.
+ class AssociationDefinitionError < RuntimeError; end
+
+ # Raised when a callback is defined that has an invalid name
+ 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
+end
Please sign in to comment.
Something went wrong with that request. Please try again.