Skip to content

Commit

Permalink
Add documentation about how to use FG without Rails/Bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaclayton committed Jun 19, 2012
1 parent 1b37231 commit 4a16f72
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions GETTING_STARTED.md
Expand Up @@ -18,6 +18,44 @@ gem "factory_girl", "~> 3.0"

Once your Gemfile is updated, you'll want to update your bundle.

Using Without Bundler
---------------------

If you're not using Bundler, be sure to have the gem installed and call:

```
require 'factory_girl'
```

Once required, assuming you have a directory structure of `spec/factories` or
`test/factories`, all you'll need to do is run

```ruby
FactoryGirl.find_definitions
```

If you're using a separate directory structure for your factories, you can
change the definition file paths before trying to find definitions:

```ruby
FactoryGirl.definition_file_paths = %w(custom_factories_directory)
FactoryGirl.find_definitions
```

If you don't have a separate directory of factories and would like to define
them inline, that's possible as well:

```ruby
require 'factory_girl'

FactoryGirl.define do
factory :user do
name 'John Doe'
date_of_birth { 21.years.ago }
end
end
```

Defining factories
------------------

Expand Down

0 comments on commit 4a16f72

Please sign in to comment.