Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining duplicate factories should raise an error #29

Closed
r00k opened this issue Oct 30, 2009 · 1 comment
Closed

Defining duplicate factories should raise an error #29

r00k opened this issue Oct 30, 2009 · 1 comment
Labels

Comments

@r00k
Copy link
Contributor

r00k commented Oct 30, 2009

I've been bitten a few times recently by accidentally defining two factories with the same name. Factory_girl accepts this silently. I think an error is warranted: I can't think of a scenario where users are benefited by this ability and doing it inadvertently is likely to break things.

Here's my implementation. Attempting to define a second factory with the same name raises a DuplicateDefinitionError:
http://github.com/r00k/factory_girl/tree/disallow_duplicate_factory_definitions

@stevenderocher
Copy link

This was pulled 10/30/09s.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants