1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00

README patches. fixed some formatting, added alt syntax example for machinist, which is most-asked about

This commit is contained in:
Dan Croak 2010-03-28 18:34:50 -04:00
parent 3287ed8dee
commit 3405a2809e

View file

@ -12,8 +12,7 @@ Gem:
Note: if you install factory_girl using the gem from Gemcutter, you'll need this
in your environment.rb if you want to use Rails 2.1+'s dependency manager:
config.gem "factory_girl",
:source => "http://gemcutter.org"
config.gem "factory_girl", :source => "http://gemcutter.org"
== Defining factories
@ -229,17 +228,27 @@ Also, like standard attributes, child factories will inherit (and can define add
== Alternate Syntaxes
Users' tastes for syntax vary dramatically, but most users are looking for a common feature set. Because of this, factory_girl supports "syntax layers" which provide alternate interfaces. See Factory::Syntax for information about the various layers available.
Users' tastes for syntax vary dramatically, but most users are looking for a common feature set. Because of this, factory_girl supports "syntax layers" which provide alternate interfaces. See Factory::Syntax for information about the various layers available. For example, the Machinist-style syntax is popular:
require 'factory_girl/syntax/blueprint'
require 'factory_girl/syntax/make'
require 'factory_girl/syntax/sham'
Sham.email {|n| "#{n}@example.com" }
User.blueprint do
name { 'Billy Bob' }
email { Sham.email }
end
User.make(:name => 'Johnny')
== More Information
Our blog: http://giantrobots.thoughtbot.com
factory_girl rdoc: http://rdoc.info/projects/thoughtbot/factory_girl
Mailing list: http://groups.google.com/group/factory_girl
factory_girl issues: http://github.com/thoughtbot/factory_girl/issues
* RDoc[http://rdoc.info/projects/thoughtbot/factory_girl]
* Mailing list[http://groups.google.com/group/factory_girl]
* Issues[http://github.com/thoughtbot/factory_girl/issues]
* GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS[http://giantrobots.thoughtbot.com]
== Contributing
@ -262,4 +271,4 @@ The syntax layers are derived from software written by the following authors:
Thanks to all members of thoughtbot for inspiration, ideas, and funding.
Copyright 2008-2009 Joe Ferris and thoughtbot[http://www.thoughtbot.com], inc.
Copyright 2008-2010 Joe Ferris and thoughtbot[http://www.thoughtbot.com], inc.