Skip to content

Instantly share code, notes, and snippets.

@pjb3
Created February 25, 2013 23:30
Show Gist options
  • Save pjb3/5034333 to your computer and use it in GitHub Desktop.
Save pjb3/5034333 to your computer and use it in GitHub Desktop.
# 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?
@jjulian
Copy link

jjulian commented Feb 26, 2013

Fork and PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment