Created
February 25, 2013 23:30
-
-
Save pjb3/5034333 to your computer and use it in GitHub Desktop.
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
# Why do I have to have two levels of blocks? | |
FactoryGirl.define do | |
factory :user do | |
name "test" | |
end | |
end | |
# Why can't I just do something like this? | |
FactoryGirl.factory(:user) do | |
name "test" | |
end | |
# Well, I mean, I can, of course, if I do this | |
module FactoryGirl | |
def self.factory(*args, &block) | |
define do | |
factory(*args, &block) | |
end | |
end | |
end | |
# But why isn't this supported by default in FactoryGirl? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fork and PR?