Permalink
Browse files

I've grown up to be a woman

  • Loading branch information...
1 parent 845a76a commit 218d7bedfe41c400c804f1994983d3eabe1977a2 Harold Giménez committed Nov 18, 2011
Showing with 645 additions and 645 deletions.
  1. +2 −2 CONTRIBUTION_GUIDELINES.md
  2. +45 −45 GETTING_STARTED.md
  3. +2 −2 Gemfile.lock
  4. +14 −14 README.md
  5. +2 −2 Rakefile
  6. +6 −6 factory_girl.gemspec → factory_woman.gemspec
  7. +14 −14 features/find_definitions.feature
  8. +10 −10 features/step_definitions/factory_girl_steps.rb
  9. +1 −1 features/support/env.rb
  10. +2 −2 features/support/factories.rb
  11. +3 −3 gemfiles/2.1.gemfile.lock
  12. +3 −3 gemfiles/2.3.gemfile.lock
  13. +3 −3 gemfiles/3.0.gemfile.lock
  14. +3 −3 gemfiles/3.1.gemfile.lock
  15. +0 −12 lib/factory_girl/syntax.rb
  16. +1 −1 lib/{factory_girl.rb → factory_woman.rb}
  17. +1 −1 lib/{factory_girl → factory_woman}/aliases.rb
  18. +2 −2 lib/{factory_girl → factory_woman}/attribute.rb
  19. +1 −1 lib/{factory_girl → factory_woman}/attribute/association.rb
  20. +2 −2 lib/{factory_girl → factory_woman}/attribute/dynamic.rb
  21. +2 −2 lib/{factory_girl → factory_woman}/attribute/sequence.rb
  22. +1 −1 lib/{factory_girl → factory_woman}/attribute/static.rb
  23. +1 −1 lib/{factory_girl → factory_woman}/attribute_list.rb
  24. +1 −1 lib/{factory_girl → factory_woman}/callback.rb
  25. +1 −1 lib/{factory_girl → factory_woman}/declaration.rb
  26. +1 −1 lib/{factory_girl → factory_woman}/declaration/association.rb
  27. +1 −1 lib/{factory_girl → factory_woman}/declaration/dynamic.rb
  28. +3 −3 lib/{factory_girl → factory_woman}/declaration/implicit.rb
  29. +1 −1 lib/{factory_girl → factory_woman}/declaration/static.rb
  30. +1 −1 lib/{factory_girl → factory_woman}/declaration_list.rb
  31. +2 −2 lib/{factory_girl → factory_woman}/definition.rb
  32. +3 −3 lib/{factory_girl → factory_woman}/definition_proxy.rb
  33. +5 −5 lib/{factory_girl → factory_woman}/deprecated.rb
  34. +4 −4 lib/{factory_girl → factory_woman}/factory.rb
  35. +1 −1 lib/{factory_girl → factory_woman}/find_definitions.rb
  36. +1 −1 lib/{factory_girl → factory_woman}/null_factory.rb
  37. +3 −3 lib/{factory_girl → factory_woman}/proxy.rb
  38. +1 −1 lib/{factory_girl → factory_woman}/proxy/attributes_for.rb
  39. +2 −2 lib/{factory_girl → factory_woman}/proxy/build.rb
  40. +1 −1 lib/{factory_girl → factory_woman}/proxy/create.rb
  41. +2 −2 lib/{factory_girl → factory_woman}/proxy/stub.rb
  42. +2 −2 lib/{factory_girl → factory_woman}/rails2.rb
  43. +1 −1 lib/{factory_girl → factory_woman}/registry.rb
  44. +1 −1 lib/{factory_girl → factory_woman}/reload.rb
  45. +2 −2 lib/{factory_girl → factory_woman}/sequence.rb
  46. +10 −10 lib/{factory_girl → factory_woman}/step_definitions.rb
  47. +12 −0 lib/factory_woman/syntax.rb
  48. +5 −5 lib/{factory_girl → factory_woman}/syntax/blueprint.rb
  49. +7 −7 lib/{factory_girl → factory_woman}/syntax/default.rb
  50. +9 −9 lib/{factory_girl → factory_woman}/syntax/generate.rb
  51. +6 −6 lib/{factory_girl → factory_woman}/syntax/make.rb
  52. +6 −6 lib/{factory_girl → factory_woman}/syntax/methods.rb
  53. +6 −6 lib/{factory_girl → factory_woman}/syntax/sham.rb
  54. +17 −17 lib/{factory_girl → factory_woman}/syntax/vintage.rb
  55. +2 −2 lib/{factory_girl → factory_woman}/trait.rb
  56. +1 −1 lib/{factory_girl → factory_woman}/version.rb
  57. +3 −3 spec/acceptance/attribute_aliases_spec.rb
  58. +2 −2 spec/acceptance/attribute_existing_on_object.rb
  59. +4 −4 spec/acceptance/attributes_for_spec.rb
  60. +4 −4 spec/acceptance/attributes_ordered_spec.rb
  61. +3 −3 spec/acceptance/build_list_spec.rb
  62. +6 −6 spec/acceptance/build_spec.rb
  63. +4 −4 spec/acceptance/build_stubbed_spec.rb
  64. +6 −6 spec/acceptance/callbacks_spec.rb
  65. +3 −3 spec/acceptance/create_list_spec.rb
  66. +9 −9 spec/acceptance/create_spec.rb
  67. +2 −2 spec/acceptance/default_strategy_spec.rb
  68. +2 −2 spec/acceptance/define_child_before_parent_spec.rb
  69. +2 −2 spec/acceptance/definition_spec.rb
  70. +2 −2 spec/acceptance/definition_without_block_spec.rb
  71. +13 −13 spec/acceptance/modify_factories_spec.rb
  72. +2 −2 spec/acceptance/modify_inherited_spec.rb
  73. +6 −6 spec/acceptance/overrides_spec.rb
  74. +6 −6 spec/acceptance/parent_spec.rb
  75. +3 −3 spec/acceptance/sequence_spec.rb
  76. +4 −4 spec/acceptance/stub_spec.rb
  77. +4 −4 spec/acceptance/syntax/blueprint_spec.rb
  78. +2 −2 spec/acceptance/syntax/generate_spec.rb
  79. +2 −2 spec/acceptance/syntax/make_spec.rb
  80. +3 −3 spec/acceptance/syntax/sham_spec.rb
  81. +16 −16 spec/acceptance/syntax/vintage_spec.rb
  82. +18 −18 spec/acceptance/traits_spec.rb
  83. +14 −14 spec/acceptance/transient_attributes_spec.rb
  84. +5 −5 spec/factory_girl/aliases_spec.rb
  85. +4 −4 spec/factory_girl/attribute/association_spec.rb
  86. +5 −5 spec/factory_girl/attribute/dynamic_spec.rb
  87. +4 −4 spec/factory_girl/attribute/sequence_spec.rb
  88. +4 −4 spec/factory_girl/attribute/static_spec.rb
  89. +16 −16 spec/factory_girl/attribute_list_spec.rb
  90. +5 −5 spec/factory_girl/attribute_spec.rb
  91. +11 −11 spec/factory_girl/callback_spec.rb
  92. +5 −5 spec/factory_girl/declaration/implicit_spec.rb
  93. +4 −4 spec/factory_girl/declaration_list_spec.rb
  94. +36 −36 spec/factory_girl/definition_proxy_spec.rb
  95. +13 −13 spec/factory_girl/definition_spec.rb
  96. +9 −9 spec/factory_girl/deprecated_spec.rb
  97. +57 −57 spec/factory_girl/factory_spec.rb
  98. +7 −7 spec/factory_girl/find_definitions_spec.rb
  99. +2 −2 spec/factory_girl/null_factory_spec.rb
  100. +2 −2 spec/factory_girl/proxy/attributes_for_spec.rb
  101. +4 −4 spec/factory_girl/proxy/build_spec.rb
  102. +8 −8 spec/factory_girl/proxy/create_spec.rb
  103. +4 −4 spec/factory_girl/proxy/stub_spec.rb
  104. +10 −10 spec/factory_girl/proxy_spec.rb
  105. +7 −7 spec/factory_girl/registry_spec.rb
  106. +5 −5 spec/factory_girl/sequence_spec.rb
  107. +10 −10 spec/factory_girl_spec.rb
  108. +4 −4 spec/spec_helper.rb
  109. +1 −1 spec/support/matchers/callback.rb
  110. +4 −4 spec/support/matchers/declaration.rb
  111. +1 −1 spec/support/matchers/trait.rb
  112. +11 −11 spec/support/shared_examples/proxy.rb
@@ -1,6 +1,6 @@
-Contributing to factory\_girl:
+Contributing to factory\_woman:
-1. Fork the [official repository](http://github.com/thoughtbot/factory_girl/tree/master).
+1. Fork the [official repository](http://github.com/thoughtbot/factory_woman/tree/master).
2. Make your changes in a topic branch.
3. Send a pull request.
View
@@ -4,13 +4,13 @@ Getting Started
Update Your Gemfile
-------------------
-If you're using Rails, you'll need to change the required version of `factory_girl_rails`:
+If you're using Rails, you'll need to change the required version of `factory_woman_rails`:
- gem "factory_girl_rails", "~> 1.2"
+ gem "factory_woman_rails", "~> 1.2"
-If you're *not* using Rails, you'll just have to change the required version of `factory_girl`:
+If you're *not* using Rails, you'll just have to change the required version of `factory_woman`:
- gem "factory_girl", "~> 2.1.0"
+ gem "factory_woman", "~> 2.1.0"
Once your Gemfile is updated, you'll want to update your bundle.
@@ -20,7 +20,7 @@ Defining factories
Each factory has a name and a set of attributes. The name is used to guess the class of the object by default, but it's possible to explicitly specify it:
# This will guess the User class
- FactoryGirl.define do
+ FactoryWoman.define do
factory :user do
first_name 'John'
last_name 'Doe'
@@ -57,37 +57,37 @@ are defined in files at the following locations:
Using factories
---------------
-factory\_girl supports several different build strategies: build, create, attributes\_for and stub:
+factory\_woman supports several different build strategies: build, create, attributes\_for and stub:
# Returns a User instance that's not saved
- user = FactoryGirl.build(:user)
+ user = FactoryWoman.build(:user)
# Returns a saved User instance
- user = FactoryGirl.create(:user)
+ user = FactoryWoman.create(:user)
# Returns a hash of attributes that can be used to build a User instance
- attrs = FactoryGirl.attributes_for(:user)
+ attrs = FactoryWoman.attributes_for(:user)
# Returns an object with all defined attributes stubbed out
- stub = FactoryGirl.build_stubbed(:user)
+ stub = FactoryWoman.build_stubbed(:user)
# Passing a block to any of the methods above will yield the return object
- FactoryGirl.create(:user) do |user|
+ FactoryWoman.create(:user) do |user|
user.posts.create(attributes_for(:post))
end
No matter which strategy is used, it's possible to override the defined attributes by passing a hash:
# Build a User instance and override the first_name property
- user = FactoryGirl.build(:user, :first_name => 'Joe')
+ user = FactoryWoman.build(:user, :first_name => 'Joe')
user.first_name
# => "Joe"
-If repeating "FactoryGirl" is too verbose for you, you can mix the syntax methods in:
+If repeating "FactoryWoman" is too verbose for you, you can mix the syntax methods in:
# rspec
RSpec.configure do |config|
- config.include FactoryGirl::Syntax::Methods
+ config.include FactoryWoman::Syntax::Methods
end
# Test::Unit
@@ -155,7 +155,7 @@ Attributes can be based on the values of other attributes using the proxy that i
email { "#{first_name}.#{last_name}@example.com".downcase }
end
- FactoryGirl.create(:user, :last_name => 'Doe').email
+ FactoryWoman.create(:user, :last_name => 'Doe').email
# => "joe.doe@example.com"
Transient Attributes
@@ -177,15 +177,15 @@ There may be times where your code can be DRYed up by passing in transient attri
end
end
- FactoryGirl.create(:user, :upcased => true).name
+ FactoryWoman.create(:user, :upcased => true).name
#=> "JOHN DOE - ROCKSTAR"
Static and dynamic attributes can be ignored. Ignored attributes will be ignored
within attributes\_for and won't be set on the model, even if the attribute
exists or you attempt to override it.
-Within Factory Girl's dynamic attributes, you can access ignored attributes as
-you would expect. If you need to access the proxy in a Factory Girl callback,
+Within Factory Woman's dynamic attributes, you can access ignored attributes as
+you would expect. If you need to access the proxy in a Factory Woman callback,
you'll need to declare a second block argument (for the proxy) and access
ignored attributes from there.
@@ -209,12 +209,12 @@ You can also specify a different factory or override attributes:
The behavior of the association method varies depending on the build strategy used for the parent object.
# Builds and saves a User and a Post
- post = FactoryGirl.create(:post)
+ post = FactoryWoman.create(:post)
post.new_record? # => false
post.author.new_record? # => false
# Builds and saves a User, and then builds but does not save a Post
- post = FactoryGirl.build(:post)
+ post = FactoryWoman.build(:post)
post.new_record? # => true
post.author.new_record? # => false
@@ -226,7 +226,7 @@ To not save the associated object, specify :method => :build in the factory:
end
# Builds a User, and then builds a Post, but does not save either
- post = FactoryGirl.build(:post)
+ post = FactoryWoman.build(:post)
post.new_record? # => true
post.author.new_record? # => true
@@ -243,7 +243,7 @@ You can easily create multiple factories for the same class without repeating co
end
end
- approved_post = FactoryGirl.create(:approved_post)
+ approved_post = FactoryWoman.create(:approved_post)
approved_post.title # => 'A title'
approved_post.approved # => true
@@ -268,19 +268,19 @@ Sequences
Unique values in a specific format (for example, e-mail addresses) can be
generated using sequences. Sequences are defined by calling sequence in a
definition block, and values in a sequence are generated by calling
-FactoryGirl.generate:
+FactoryWoman.generate:
# Defines a new sequence
- FactoryGirl.define do
+ FactoryWoman.define do
sequence :email do |n|
"person#{n}@example.com"
end
end
- FactoryGirl.generate :email
+ FactoryWoman.generate :email
# => "person1@example.com"
- FactoryGirl.generate :email
+ FactoryWoman.generate :email
# => "person2@example.com"
Sequences can be used as attributes:
@@ -292,7 +292,7 @@ Sequences can be used as attributes:
Or in lazy attributes:
factory :invite do
- invitee { FactoryGirl.generate(:email) }
+ invitee { FactoryWoman.generate(:email) }
end
And it's also possible to define an in-line sequence that is only used in
@@ -407,11 +407,11 @@ You can also override individual attributes granted by a trait in subclasses.
Callbacks
---------
-factory\_girl makes available three callbacks for injecting some code:
+factory\_woman makes available three callbacks for injecting some code:
-* after_build - called after a factory is built (via FactoryGirl.build)
-* after_create - called after a factory is saved (via FactoryGirl.create)
-* after_stub - called after a factory is stubbed (via FactoryGirl.stub)
+* after_build - called after a factory is built (via FactoryWoman.build)
+* after_create - called after a factory is saved (via FactoryWoman.create)
+* after_stub - called after a factory is stubbed (via FactoryWoman.stub)
Examples:
@@ -436,7 +436,7 @@ Factories can also define any number of the same kind of callback. These callba
after_create { then_this }
end
-Calling FactoryGirl.create will invoke both after\_build and after\_create callbacks.
+Calling FactoryWoman.create will invoke both after\_build and after\_create callbacks.
Also, like standard attributes, child factories will inherit (and can also define) callbacks from their parent factory.
@@ -448,7 +448,7 @@ modify that factory instead of creating a child factory and adding attributes th
If a gem were to give you a User factory:
- FactoryGirl.define do
+ FactoryWoman.define do
factory :user do
full_name "John Doe"
sequence(:username) {|n| "user#{n}" }
@@ -458,7 +458,7 @@ If a gem were to give you a User factory:
Instead of creating a child factory that added additional attributes:
- FactoryGirl.define do
+ FactoryWoman.define do
factory :application_user, :parent => :user do
full_name { Faker::Name.name }
date_of_birth { 21.years.ago }
@@ -469,7 +469,7 @@ Instead of creating a child factory that added additional attributes:
You could modify that factory instead.
- FactoryGirl.modify do
+ FactoryWoman.modify do
factory :user do
full_name { Faker::Name.name }
date_of_birth { 21.years.ago }
@@ -480,7 +480,7 @@ You could modify that factory instead.
When modifying a factory, you can change any of the attributes you want (aside from callbacks).
-`FactoryGirl.modify` must be called outside of a `FactoryGirl.define` block as it operates on factories differently.
+`FactoryWoman.modify` must be called outside of a `FactoryWoman.define` block as it operates on factories differently.
A caveat: you can only modify factories (not sequences or traits) and callbacks *still compound as they normally would*. So, if
the factory you're modifying defines an `after_create` callback, you defining an `after_create` won't override it, it'll just get run after the first callback.
@@ -490,32 +490,32 @@ Building or Creating Multiple Records
Sometimes, you'll want to create or build multiple instances of a factory at once.
- built_users = FactoryGirl.build_list(:user, 25)
- created_users = FactoryGirl.create_list(:user, 25)
+ built_users = FactoryWoman.build_list(:user, 25)
+ created_users = FactoryWoman.create_list(:user, 25)
These methods will build or create a specific amount of factories and return them as an array.
To set the attributes for each of the factories, you can pass in a hash as you normally would.
- twenty_year_olds = FactoryGirl.build_list(:user, 25, :date_of_birth => 20.years.ago)
+ twenty_year_olds = FactoryWoman.build_list(:user, 25, :date_of_birth => 20.years.ago)
Cucumber Integration
--------------------
-factory\_girl ships with step definitions that make calling factories from Cucumber easier. To use them, add the following to features/support/env.rb:
+factory\_woman ships with step definitions that make calling factories from Cucumber easier. To use them, add the following to features/support/env.rb:
- require 'factory_girl/step_definitions'
+ require 'factory_woman/step_definitions'
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
+common feature set. Because of this factory\_woman 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'
+ require 'factory_woman/syntax/blueprint'
+ require 'factory_woman/syntax/make'
+ require 'factory_woman/syntax/sham'
Sham.email {|n| "#{n}@example.com" }
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- factory_girl (2.2.0)
+ factory_woman (2.2.0)
activesupport
GEM
@@ -83,7 +83,7 @@ DEPENDENCIES
bluecloth
bourne
cucumber (~> 1.0.0)
- factory_girl!
+ factory_woman!
mocha
rcov
rspec (~> 2.0)
View
@@ -1,47 +1,47 @@
-# factory_girl [![Build Status](https://secure.travis-ci.org/thoughtbot/factory_girl.png)](http://travis-ci.org/thoughtbot/factory_girl?branch=master)
+# factory_woman [![Build Status](https://secure.travis-ci.org/thoughtbot/factory_woman.png)](http://travis-ci.org/thoughtbot/factory_woman?branch=master)
-factory_girl is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (user, admin_user, and so on), including factory inheritance.
+factory_woman is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (user, admin_user, and so on), including factory inheritance.
-If you want to use factory_girl with Rails 3, see
-[factory_girl_rails](http://github.com/thoughtbot/factory_girl_rails).
+If you want to use factory_woman with Rails 3, see
+[factory_woman_rails](http://github.com/thoughtbot/factory_woman_rails).
Documentation
-------------
-You should find the documentation for your version of factory_girl on [Rubygems](http://rubygems.org/gems/factory_girl).
+You should find the documentation for your version of factory_woman on [Rubygems](http://rubygems.org/gems/factory_woman).
See {file:GETTING_STARTED.md} for information on defining and using factories.
Install
--------
```shell
-gem install factory_girl
+gem install factory_woman
```
or add the following line to Gemfile:
```ruby
-gem 'factory_girl'
+gem 'factory_woman'
```
and run `bundle install` from your shell.
More Information
----------------
-* [Rubygems](http://rubygems.org/gems/factory_girl)
-* [Mailing list](http://groups.google.com/group/factory_girl)
-* [Issues](http://github.com/thoughtbot/factory_girl/issues)
+* [Rubygems](http://rubygems.org/gems/factory_woman)
+* [Mailing list](http://groups.google.com/group/factory_woman)
+* [Issues](http://github.com/thoughtbot/factory_woman/issues)
* [GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS](http://giantrobots.thoughtbot.com)
Contributing
------------
-Please see the [contribution guidelines](http://github.com/thoughtbot/factory_girl/blob/master/CONTRIBUTION_GUIDELINES.md).
+Please see the [contribution guidelines](http://github.com/thoughtbot/factory_woman/blob/master/CONTRIBUTION_GUIDELINES.md).
Credits
-------
-factory_girl was written by Joe Ferris with contributions from several authors, including:
+factory_woman was written by Joe Ferris with contributions from several authors, including:
* Alex Sharp
* Eugene Bolshakov
@@ -60,11 +60,11 @@ The syntax layers are derived from software written by the following authors:
![thoughtbot](http://thoughtbot.com/images/tm/logo.png)
-factory_girl is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community)
+factory_woman is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community)
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
License
-------
-factory_girl is Copyright © 2008-2011 Joe Ferris and thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.
+factory_woman is Copyright © 2008-2011 Joe Ferris and thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.
View
@@ -17,7 +17,7 @@ end
namespace :spec do
desc "Run unit specs"
RSpec::Core::RakeTask.new('unit') do |t|
- t.pattern = 'spec/{*_spec.rb,factory_girl/**/*_spec.rb}'
+ t.pattern = 'spec/{*_spec.rb,factory_woman/**/*_spec.rb}'
end
desc "Run acceptance specs"
@@ -29,7 +29,7 @@ end
desc "Run the unit and acceptance specs"
task :spec => ['spec:unit', 'spec:acceptance']
-desc 'Performs code coverage on the factory_girl plugin.'
+desc 'Performs code coverage on the factory_woman plugin.'
RSpec::Core::RakeTask.new(:rcov) do |task|
task.pattern = 'spec/**/*_spec.rb'
task.rcov = true
Oops, something went wrong.

1 comment on commit 218d7be

@ambethia

Congrats!

Please sign in to comment.