-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly support pluralized words in generated step definitions.
- Loading branch information
1 parent
389ec8f
commit 1d42b18
Showing
3 changed files
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ | |
Before do | ||
Post.delete_all | ||
User.delete_all | ||
Category.delete_all | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1d42b18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I had just sat down to write a patch. Now I'll just upgrade our project to the latest version. :)
Question: Doesn't this add an undeclared runtime dependency on activesupport?
1d42b18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's been annoying me for a while. It does add an undeclared dependency, but odds are you're using these step definitions with Rails. Perhaps this should be moved to the new factory_girl_rails gem instead.
1d42b18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach I was going to take with the patch was to define factory#plural_human_name that internally used #pluralize if it was defined or drop-back to dumb "s" concatenation if it was undefined. That way activesupport is a non-breaking optional dependency.