factory_bot 4.10.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/CONTRIBUTING.md +52 -13
  4. data/GETTING_STARTED.md +613 -182
  5. data/LICENSE +1 -1
  6. data/NEWS.md +358 -0
  7. data/README.md +30 -26
  8. data/lib/factory_bot.rb +71 -140
  9. data/lib/factory_bot/aliases.rb +2 -2
  10. data/lib/factory_bot/attribute.rb +4 -39
  11. data/lib/factory_bot/attribute/association.rb +2 -2
  12. data/lib/factory_bot/attribute/dynamic.rb +2 -1
  13. data/lib/factory_bot/attribute_assigner.rb +24 -10
  14. data/lib/factory_bot/attribute_list.rb +3 -2
  15. data/lib/factory_bot/callback.rb +3 -10
  16. data/lib/factory_bot/configuration.rb +15 -19
  17. data/lib/factory_bot/declaration.rb +5 -5
  18. data/lib/factory_bot/declaration/association.rb +14 -1
  19. data/lib/factory_bot/declaration/dynamic.rb +3 -1
  20. data/lib/factory_bot/declaration/implicit.rb +7 -2
  21. data/lib/factory_bot/declaration_list.rb +3 -3
  22. data/lib/factory_bot/decorator.rb +5 -5
  23. data/lib/factory_bot/decorator/attribute_hash.rb +1 -1
  24. data/lib/factory_bot/decorator/invocation_tracker.rb +1 -1
  25. data/lib/factory_bot/definition.rb +49 -20
  26. data/lib/factory_bot/definition_hierarchy.rb +1 -11
  27. data/lib/factory_bot/definition_proxy.rb +125 -43
  28. data/lib/factory_bot/enum.rb +27 -0
  29. data/lib/factory_bot/errors.rb +7 -4
  30. data/lib/factory_bot/evaluation.rb +1 -1
  31. data/lib/factory_bot/evaluator.rb +9 -11
  32. data/lib/factory_bot/evaluator_class_definer.rb +1 -1
  33. data/lib/factory_bot/factory.rb +12 -12
  34. data/lib/factory_bot/factory_runner.rb +4 -4
  35. data/lib/factory_bot/find_definitions.rb +2 -2
  36. data/lib/factory_bot/internal.rb +91 -0
  37. data/lib/factory_bot/linter.rb +41 -28
  38. data/lib/factory_bot/null_factory.rb +13 -4
  39. data/lib/factory_bot/null_object.rb +2 -6
  40. data/lib/factory_bot/registry.rb +17 -8
  41. data/lib/factory_bot/reload.rb +2 -3
  42. data/lib/factory_bot/sequence.rb +5 -6
  43. data/lib/factory_bot/strategy/stub.rb +37 -37
  44. data/lib/factory_bot/strategy_calculator.rb +1 -1
  45. data/lib/factory_bot/strategy_syntax_method_registrar.rb +13 -2
  46. data/lib/factory_bot/syntax.rb +2 -2
  47. data/lib/factory_bot/syntax/default.rb +12 -24
  48. data/lib/factory_bot/syntax/methods.rb +32 -9
  49. data/lib/factory_bot/trait.rb +7 -4
  50. data/lib/factory_bot/version.rb +1 -1
  51. metadata +50 -65
  52. data/.autotest +0 -9
  53. data/.gitignore +0 -10
  54. data/.rspec +0 -3
  55. data/.simplecov +0 -4
  56. data/.travis.yml +0 -58
  57. data/Appraisals +0 -23
  58. data/Gemfile +0 -8
  59. data/Gemfile.lock +0 -103
  60. data/NEWS +0 -298
  61. data/Rakefile +0 -36
  62. data/cucumber.yml +0 -1
  63. data/factory_bot.gemspec +0 -36
  64. data/factory_girl.gemspec +0 -40
  65. data/gemfiles/3.2.gemfile +0 -10
  66. data/gemfiles/3.2.gemfile.lock +0 -107
  67. data/gemfiles/4.0.gemfile +0 -10
  68. data/gemfiles/4.0.gemfile.lock +0 -107
  69. data/gemfiles/4.1.gemfile +0 -10
  70. data/gemfiles/4.1.gemfile.lock +0 -106
  71. data/gemfiles/4.2.gemfile +0 -10
  72. data/gemfiles/4.2.gemfile.lock +0 -106
  73. data/gemfiles/5.0.gemfile +0 -10
  74. data/gemfiles/5.0.gemfile.lock +0 -104
  75. data/gemfiles/5.1.gemfile +0 -10
  76. data/gemfiles/5.1.gemfile.lock +0 -104
  77. data/lib/factory_bot/attribute/static.rb +0 -16
  78. data/lib/factory_bot/declaration/static.rb +0 -26
  79. data/lib/factory_bot/decorator/class_key_hash.rb +0 -28
  80. data/lib/factory_girl.rb +0 -5
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008-2017 Joe Ferris and thoughtbot, inc.
1
+ Copyright (c) 2008-2019 Joe Ferris and thoughtbot, inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/NEWS.md ADDED
@@ -0,0 +1,358 @@
1
+ # News
2
+
3
+ ## 6.0.0 (June 18, 2020)
4
+ * Added: automatic definition of traits for Active Record enum attributes, enabled by default
5
+ * Added: `traits_for_enum` method to define traits for non-Active Record enums
6
+ * Added: `build_stubbed_starting_id=` option to define the starting id for `build_stubbed`
7
+ * Removed: deprecated methods on the top-level `FactoryBot` module meant only for internal use
8
+ * Removed: support for EOL versions of Ruby (2.3, 2.4) and Rails (4.2)
9
+
10
+ ## 5.2.0 (April 24, 2020)
11
+ * Added: Pass index to block for `*_list` methods
12
+ * Deprecated: methods on the top-level `FactoryBot` module meant only for internal use: `callbacks`, `configuration`, `constructor`, `initialize_with`, `register_sequence`, `resent_configuration`, `skip_create`, `to_create`
13
+
14
+ ## 5.1.2 (March 25, 2020)
15
+ * Fixed: Ruby 2.7 keyword deprecation warning in FactoryBot.lint
16
+
17
+ ## 5.1.1 (October 2, 2019)
18
+ * Improved: performance of traits
19
+ * Fixed: registering strategies on JRuby
20
+
21
+ ## 5.1.0 (September 21, 2019)
22
+ * Added: "Did you mean?" style error message to help with typos in association declarations
23
+ * Changed: `NoMethodError` for static attributes now offers a "Did you mean?" style message
24
+ * Fixed: avoid undefining inherited evaluator methods
25
+ * Fixed: avoid stubbing id for records without a primary key
26
+ * Fixed: raise a helpful error for self-referencing traits to avoid a `SystemStackError`
27
+ * Deprecated: methods on the top-level `FactoryBot` module meant only for internal use: `allow_class_lookup`, `allow_class_lookup`=, `register_trait`, `trait_by_name`, `traits`, `sequence_by_name`, `sequences`, `factory_by_name`, `register_factory`, `callback_names`, `register_callback`, `register_default_callbacks`, `register_default_strategies`, `strategies`
28
+
29
+ ## 5.0.2 (February 22, 2019)
30
+ * Bugfix: raise "Trait not registered" error when passing invalid trait arguments
31
+
32
+ ## 5.0.1 (February 15, 2019)
33
+ * Bugfix: Do not raise error when two sequences have the same name
34
+ in two traits that have the same name
35
+
36
+ ## 5.0.0 (February 1, 2019)
37
+ * Added: Verbose option to include full backtraces in the linting output
38
+ * Changed: use_parent_strategy now defaults to true, so by default the
39
+ build strategy will build, rather than create associations
40
+ * Changed: Passing a block when defining associations now raises an error
41
+ * Bugfix: use_parent_strategy is no longer reset by FactoryBot.reload
42
+ * Bugfix: rewind_sequences will now rewind local sequences along with the global ones
43
+ * Bugfix: the build_stubbed strategy now sets timestamps without changing the
44
+ the original behavior of the timestamp methods
45
+ * Bugfix: avoid a stack error when referring to an "attributes" attribute in initialize_with
46
+ * Removed: support for EOL versions of Ruby and Rails
47
+ * Removed: static attributes (use dynamic attributes with a block instead)
48
+ * Removed: looking up factories by class
49
+ * Removed: ignore method (use transient instead)
50
+ * Removed: duplicate_attribute_assignment_from_initialize_with configuration option
51
+ * Deprecated: allow_class_lookup configuration option
52
+
53
+ ## 4.11.1 (September 7, 2018)
54
+ * Documentation: Include .yardopts in the gem to fix broken RubyDoc links
55
+
56
+ ## 4.11.0 (August, 15, 2018)
57
+ * Bugfix: Do not raise error for valid build_stubbed methods: decrement, increment, and toggle
58
+ * Bugfix: Do not add timestamps with build_stubbed for objects that shouldn't have timestamps
59
+ * Deprecate static attributes
60
+
61
+ ## 4.10.0 (May 25, 2018)
62
+ * Allow sequences to be rewound
63
+
64
+ ## 4.9.0 (skipped - FactoryGirl only release)
65
+
66
+ ## 4.8.2 (October 20, 2017)
67
+ * Rename factory_girl to factory_bot
68
+
69
+ ## 4.8.1 (September 28, 2017)
70
+ * Explicitly define `#destroyed?` within the `Stub` strategy to return `nil` instead of raising
71
+ * Update various dependencies
72
+ * Update internal test suite to use RSpec's mocking/stubbing instead of mocha
73
+
74
+ ## 4.8.0 (December 16, 2016)
75
+ * Improve documentation
76
+ * Add `FactoryGirl.generate_list` to be consistent with `build_list`/`create_list` and friends
77
+ * Add `FactoryGirl.use_parent_strategy` configuration to allow associations to leverage parent build strategy
78
+
79
+ ## 4.7.0 (April 1, 2016)
80
+ * Improve documentation
81
+ * Improve instrumentation payload to include traits, overrides, and the factory itself
82
+ * Allow linting of traits
83
+ * Deprecate factory lookup by class name in preparation for 5.0
84
+ * Improve internal performance by using flat_map instead of map and compact
85
+ * Improve handling of dirty attributes after building a stubbed object
86
+ * Reduce warnings from redefining methods
87
+
88
+ ## 4.6.0 (skipped)
89
+
90
+ ## 4.5.0 (October 17, 2014)
91
+ * Improve FactoryGirl.lint by including exception and message in output
92
+ * Allow selective linting
93
+ * Use more explicit #public_send when doing attribute assignment
94
+ * Improve documentation around FactoryGirl.lint and initialize_with
95
+ * Deprecate #ignore in favor of #transient
96
+
97
+ ## 4.4.0 (February 10, 2014)
98
+ * Add FactoryGirl.lint
99
+ * Fix memory leak in duplicate traits
100
+ * Update documentation
101
+
102
+ ## 4.3.0 (November 3, 2013)
103
+ * Start testing against Rails 4.0 and Ruby 2.0.0
104
+ * Stop testing against Rails 3.0 and Ruby 1.9.2
105
+ * Add `*_pair` methods to only build two objects
106
+ * Raise if a method is defined with a FactoryGirl block (factory or trait)
107
+ * Allow use of Symbol#to_proc in callbacks
108
+ * Add global callbacks
109
+ * Improve GETTING_STARTED and README
110
+
111
+ ## 4.2.0 (January 18, 2013)
112
+ * Improve documentation
113
+ * Allow `*_list` syntax methods to accept a block
114
+ * Update gem dependencies
115
+ * Allow setting id for objects created with `build_stubbed`
116
+ * Fix Stub strategy to mimic ActiveRecord regarding `created_at`
117
+ * Evaluate sequences within the context of an Evaluator
118
+ * Fix Mocha deprecation warning
119
+ * Fix some warnings when running RUBYOPT=-w rake
120
+ * Convert test suite to RSpec's "expect" syntax
121
+
122
+ ## 4.1.0 (September 11, 2012)
123
+ * Allow multiple callbacks to bind to the same block
124
+ * Fix documentation surrounding the stub strategy
125
+
126
+ ## 4.0.0 (August 3, 2012)
127
+ * Remove deprecated cucumber_steps
128
+ * Remove deprecated alternate syntaxes
129
+ * Deprecate duplicate_attribute_assignment_from_initialize_with, which is now unused
130
+ as attributes assigned within initialize_with are not subsequently assigned
131
+
132
+ ## 3.6.1 (August 2, 2012)
133
+ Update README to include info about running with JRuby
134
+ * Update dependencies on RSpec and tiny versions of Rails in Appraisal
135
+ * Improve flexibility of using traits with associations and add documentation
136
+ * Stub update_column to raise to mirror ActiveRecord's change from update_attribute
137
+
138
+ ## 3.6.0 (July 27, 2012)
139
+ * Code/spec cleanup
140
+ * Allow factories with traits to be used in associations
141
+ * Refactor Factory to use DefinitionHierarchy to handle managing callbacks,
142
+ custom constructor, and custom to_create
143
+ * Add memoization to speed up factories providing attribute overrides
144
+ * Add initial support of JRuby when running in 1.9 mode
145
+ * Improve docs on what happens when including FactoryGirl::Syntax::Methods
146
+
147
+ ## 3.5.0 (June 22, 2012)
148
+ * Allow created_at to be set when using build_stubbed
149
+ * Deprecate FactoryGirl step definitions
150
+
151
+ ## 3.4.2 (June 19, 2012)
152
+ * Fix bug in traits with callbacks called implicitly in factories whose
153
+ callbacks trigger multiple times
154
+
155
+ ## 3.4.1 (June 18, 2012)
156
+ * Fix traits so they can be nested and referred to from other traits
157
+
158
+ ## 3.4.0 (June 11, 2012)
159
+ * Sequences support Enumerators
160
+ * Optionally disable duplicate assignment of attributes in initialize_with
161
+ * Make hash of public attributes available in initialize_with
162
+ * Support referring to a factory based on class name
163
+
164
+ ## 3.3.0 (May 13, 2012)
165
+ * Allow to_create, skip_create, and initialize_with to be defined globally
166
+ * Allow to_create, skip_create, and initialize_with to be defined within traits
167
+ * Fix deprecation messages for alternate syntaxes (make, generate, etc.)
168
+ * Improve library documentation
169
+ * Deprecate after_build, after_create, before_create, after_stub in favor of new callbacks
170
+ * Introduce new callback syntax: after(:build) {}, after(:custom) {}, or callback(:different) {}
171
+ This allows for declaring any callback, usable with custom strategies
172
+ * Add attributes_for_list and build_stubbed_list with the StrategySyntaxMethodRegistrar
173
+ * Allow use of syntax methods (build, create, generate, etc) implicitly in callbacks
174
+ * Internal refactoring of a handful of components
175
+
176
+ ## 3.2.0 (April 24, 2012)
177
+ * Use AS::Notifications for pub/sub to track running factories
178
+ * Call new within initialize_with implicitly on the build class
179
+ * Skip to_create with skip_create
180
+ * Allow registration of custom strategies
181
+ * Deprecate alternate syntaxes
182
+ * Implicitly call factory_bot's syntax methods from dynamic attributes
183
+
184
+ ## 3.1.0 (April 6, 2012)
185
+ * Sequences support aliases, which reference the same block
186
+ * Update documentation
187
+ * Add before_create callback
188
+ * Support use of #attribute_names method to determine available attributes for steps
189
+ * Use ActiveSupport::Deprecation for all deprecations
190
+
191
+ ## 3.0.0 (March 23, 2012)
192
+ * Deprecate the vintage syntax
193
+ * Remove Rails 2.x support
194
+ * Remove Ruby 1.8 support
195
+ * Remove deprecated features, including default_strategy, factory_name,
196
+ :method for defining default strategy, ignore on individual attributes, and
197
+ interacting with Factory the way you would FactoryGirl
198
+
199
+ ## 2.6.4 (March 16, 2012)
200
+ * Do not ignore names of transient attributes
201
+ * Ensure attributes set on instance are calculated uniquely
202
+
203
+ ## 2.6.3 (March 9, 2012)
204
+ * Fix issue with traits not being present the first time a factory is accessed
205
+ * Update available Cucumber step definitions to not require a trailing colon
206
+ when building a table of attributes to instantiate records with
207
+
208
+ ## 2.6.2 (March 9, 2012)
209
+ * Allow factories to use all their ancestors' traits
210
+ * Ignore bin dir generated by bundler
211
+ * Namespace ::Factory as top-level to fix vintage syntax issue with
212
+ Ruby 1.9.2-p3p18
213
+
214
+ ## 2.6.1 (March 2, 2012)
215
+ * Use FactoryGirl.reload in specs
216
+ * Clean up running named factories with a particular strategy with
217
+ FactoryGirl::FactoryRunner
218
+
219
+ ## 2.6.0 (February 17, 2012)
220
+ * Improve documentation of has_many associations in the GETTING_STARTED
221
+ document
222
+ * Deprecate :method in favor of :strategy when overriding an association's
223
+ build strategy
224
+
225
+ ## 2.5.2 (February 10, 2012)
226
+ * Fix step definitions to use associations defined in parent factories
227
+ * Add inline trait support to (build|create)_list
228
+ * Update ActiveSupport dependency to >= 2.3.9, which introduced
229
+ class_attribute
230
+
231
+ ## 2.5.1 (February 3, 2012)
232
+ * Fix attribute evaluation when the attribute isn't defined in the factory but
233
+ is a private method on Object
234
+ * Update rubygems on Travis before running tests
235
+ * Fix spec name
236
+ * Update GETTING_STARTED with correct usage of build_stubbed
237
+ * Update README with more info on initialize_with
238
+ * Honor :parent on factory over block nesting
239
+
240
+ ## 2.5.0 (January 20, 2012)
241
+ * Revert 'Deprecate build_stubbed and attributes_for'
242
+ * Implement initialize_with to allow overriding object instantiation
243
+ * Ensure FG runs against Rails 3.2.0
244
+
245
+ ## 2.4.2 (January 18, 2012)
246
+ * Fix inline traits' interaction with defaults on the factory
247
+
248
+ ## 2.4.1 (January 17, 2012)
249
+ * Deprecate build_stubbed and attributes_for
250
+ * Fix inline traits
251
+
252
+ ## 2.4.0 (January 13, 2012)
253
+ * Refactor internals of FactoryGirl to use anonymous class on which attributes
254
+ get defined
255
+ * Explicitly require Ruby 1.8.7 or higher in gemspec
256
+ * Fix documentation
257
+ * Add Gemnasium status to documentation
258
+ * Supplying a Class to a factory that overrides to_s no longer results in
259
+ getting the wrong Class constructed
260
+ * Be more agnostic about ORMs when using columns in FactoryGirl step
261
+ definitions
262
+ * Test against Active Record 3.2.0.rc2
263
+ * Update GETTING_STARTED to use Ruby syntax highlighting
264
+
265
+ ## 2.3.2 (November 26, 2011)
266
+ * Move logic of where instance.save! is set to Definition
267
+ * Fix method name from aliases_for? to alias_for?
268
+ * Refactor internal attribute handling to use an anonymous class instead of
269
+ faking Ruby's variable resolution. This allows for more sane usage of
270
+ attributes without having to manage sorting priority because attributes
271
+ can turn themselves into procs, which are used with define_method on a
272
+ class so attributes work correctly all the time.
273
+
274
+ ## 2.3.1 (November 23, 2011)
275
+ * Remove internally-used associate method from all the FactoryGirl::Proxy subclasses
276
+ * Move around requiring of files
277
+ * Consolidate errors into factory_bot.rb
278
+ * Refactor AttributeList to deal with priority only when iterating over
279
+ attributes
280
+ * Refactor internals of some of the Proxy subclasses
281
+ * Ensure callbacks on traits are executed in the correct order
282
+
283
+ ## 2.3.0 (November 18, 2011)
284
+ * Registries are named, resulting in better messages when factories, traits,
285
+ or sequences cannot be found
286
+ * Fix incorrect tests
287
+ * Internals refactoring introducing FactoryGirl::NullFactory,
288
+ FactoryGirl::Definition, and FactoryGirl::DeclarationList
289
+ * Use ActiveSupport for Hash#except and its delegation capabilities
290
+ * Fix usage of callbacks when added via implicit traits
291
+ * Use Bundler tasks and clean up dependencies
292
+ * Fix failing spec for big letters in factory name passed as symbol
293
+ * Add ability for traits to be added dynamically when creating an instance via
294
+ build, create, build_stubbed, or attributes_for
295
+
296
+ ## 2.2.0 (October 14, 2011)
297
+ * Clean up RSpec suite to not use 'should'
298
+ * Use create_list in step definitions
299
+ * Syntax methods that deal with ORM interaction (attributes_for, build, build_stubbed,
300
+ and create) now accept a block that yields the result. This results in a
301
+ more convenient way to interact with the result than using Object.tap.
302
+ * Standardize deprecation warnings
303
+ * Update transient attribute syntax to use blocks instead of calling ignore on
304
+ each attribute declaration
305
+ * Parents can be defined after children because factories are evaluated when
306
+ they're used; this means breaking up factories across multiple files will
307
+ behave as expected
308
+ * Large internal refactoring, including changing access modifiers for a
309
+ handful of methods for a more clearly defined API
310
+
311
+ ## 2.1.2 (September 23, 2011)
312
+ * Bugfix: Vintage syntax fixed after bug introduced in 2.1.1
313
+ * Introduce dependency on activesupport to remove code from Factory class
314
+
315
+ ## 2.1.1 (September 23, 2011) (yanked)
316
+ * Bugfix: Parent object callbacks are run before child object callbacks
317
+ * Declarations: allow overriding/modification of individual traits in child factories
318
+ * Callbacks refactored to not be attributes
319
+ * Updating documentation for formatting and clarity (incl. new specificity for cucumber)
320
+
321
+ ## 2.1.0 (September 02, 2011)
322
+ * Bugfix: created_at now defined for stubbed models
323
+ * Gemspec updated for use with Rails 3.1
324
+ * Factories can now be modified post-definition (useful for overriding defaults from gems/plugins)
325
+ * All factories can now be reloaded with Factory.reload
326
+ * Add :method => build to factory associations to prevent saving of associated objects
327
+ * Factories defined in {Rails.root}/factories are now loaded by default
328
+ * Various documentation updates
329
+
330
+ ## 1.1.4 (November 28, 2008)
331
+ * Factory.build now uses Factory.create for associations of the built object
332
+ * Factory definitions are now detected in subdirectories, such as
333
+ factories/person_factory.rb (thanks to Josh Nichols)
334
+ * Factory definitions are now loaded after the environment in a Rails project
335
+ (fixes some issues with dependencies being loaded too early) (thanks to
336
+ Josh Nichols)
337
+ * Factory names ending in 's' no longer cause problems (thanks to Alex Sharp
338
+ and Josh Owens)
339
+
340
+ ## 1.1.3 (September 12, 2008)
341
+ * Automatically pull in definitions from factories.rb, test/factories.rb, or
342
+ spec/factories.rb
343
+ ## 1.1.2 (July 30, 2008)
344
+ * Improved error handling for invalid and undefined factories/attributes
345
+ * Improved handling of strings vs symbols vs classes
346
+ * Added a prettier syntax for handling associations
347
+ * Updated documentation and fixed compatibility with Rails 2.1
348
+
349
+ ## 1.1.1 (June 23, 2008)
350
+ * The attribute "name" no longer requires using #add_attribute
351
+
352
+ ## 1.1.0 (June 03, 2008)
353
+ * Added support for dependent attributes
354
+ * Fixed the attributes_for build strategy to not build associations
355
+ * Added support for sequences
356
+
357
+ ## 1.0.0 (May 31, 2008)
358
+ * First version
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # factory_bot [![Build Status](https://travis-ci.org/thoughtbot/factory_bot.svg)](http://travis-ci.org/thoughtbot/factory_bot?branch=master) [![Code Climate](https://codeclimate.com/github/thoughtbot/factory_bot/badges/gpa.svg)](https://codeclimate.com/github/thoughtbot/factory_bot)
1
+ # factory_bot [![Build Status][ci-image]][ci] [![Code Climate][grade-image]][grade] [![Gem Version][version-image]][version] [![Reviewed by Hound][hound-badge-image]][hound]
2
2
 
3
3
  factory_bot 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.
4
4
 
5
5
  If you want to use factory_bot with Rails, see
6
6
  [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails).
7
7
 
8
- _[Interested in the history of the project name?](NAME.md)_
8
+ _[Interested in the history of the project name?][NAME]_
9
9
 
10
10
 
11
11
  ### Transitioning from factory\_girl?
@@ -21,7 +21,7 @@ You should find the documentation for your version of factory_bot on [Rubygems](
21
21
  See [GETTING_STARTED] for information on defining and using factories. We also
22
22
  have [a detailed introductory video][], available for free on Upcase.
23
23
 
24
- [a detailed introductory video]: https://upcase.com/videos/factory-girl?utm_source=github&utm_medium=open-source&utm_campaign=factory-girl
24
+ [a detailed introductory video]: https://upcase.com/videos/factory-bot?utm_source=github&utm_medium=open-source&utm_campaign=factory-girl
25
25
 
26
26
  Install
27
27
  --------
@@ -40,22 +40,11 @@ To install the gem manually from your shell, run:
40
40
  gem install factory_bot
41
41
  ```
42
42
 
43
- **Caveat:** As of ActiveSupport 5.0 and above, Ruby 2.2.2+ is required. Because
44
- of Rubygems' dependency resolution when installing gems, you may see an error
45
- similar to:
46
-
47
- ```
48
- $ gem install factory_bot
49
- ERROR: Error installing factory_bot:
50
- activesupport requires Ruby version >= 2.2.2.
51
- ```
52
-
53
- To bypass this, install a pre-5.0 version of ActiveSupport before installing
54
- manually.
55
-
56
43
  Supported Ruby versions
57
44
  -----------------------
58
45
 
46
+ The factory_bot 5.x series supports MRI Ruby 2.3+.
47
+
59
48
  The factory_bot 3.x+ series supports MRI Ruby 1.9. Additionally, factory_bot
60
49
  3.6+ supports JRuby 1.6.7.2+ while running in 1.9 mode. See [GETTING_STARTED]
61
50
  for more information on configuring the JRuby environment.
@@ -66,34 +55,41 @@ More Information
66
55
  ----------------
67
56
 
68
57
  * [Rubygems](https://rubygems.org/gems/factory_bot)
69
- * [Stack Overflow](http://stackoverflow.com/questions/tagged/factory-bot)
58
+ * [Stack Overflow](https://stackoverflow.com/questions/tagged/factory-bot)
70
59
  * [Issues](https://github.com/thoughtbot/factory_bot/issues)
71
- * [GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS](http://robots.thoughtbot.com/)
60
+ * [GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS](https://robots.thoughtbot.com/)
61
+
62
+ [GETTING_STARTED]: https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md
63
+ [NAME]: https://github.com/thoughtbot/factory_bot/blob/master/NAME.md
72
64
 
73
- You may also find useful information under the [factory_girl tag on Stack Overflow](http://stackoverflow.com/questions/tagged/factory-girl).
65
+ Useful Tools
66
+ ------------
74
67
 
75
- [GETTING_STARTED]: http://rubydoc.info/gems/factory_bot/file/GETTING_STARTED.md
68
+ * [FactoryTrace](https://github.com/djezzzl/factory_trace) - helps to find unused factories and traits.
76
69
 
77
70
  Contributing
78
71
  ------------
79
72
 
80
73
  Please see [CONTRIBUTING.md](https://github.com/thoughtbot/factory_bot/blob/master/CONTRIBUTING.md).
81
74
 
82
- factory_bot was originally written by Joe Ferris and is now maintained by Josh
83
- Clayton. Many improvements and bugfixes were contributed by the [open source
75
+ factory_bot was originally written by Joe Ferris and is maintained by thoughtbot.
76
+ Many improvements and bugfixes were contributed by the [open source
84
77
  community](https://github.com/thoughtbot/factory_bot/graphs/contributors).
85
78
 
86
79
  License
87
80
  -------
88
81
 
89
- factory_bot is Copyright © 2008-2016 Joe Ferris and thoughtbot. It is free
82
+ factory_bot is Copyright © 2008-2020 Joe Ferris and thoughtbot. It is free
90
83
  software, and may be redistributed under the terms specified in the
91
- [LICENSE](/LICENSE) file.
84
+ [LICENSE] file.
85
+
86
+ [LICENSE]: https://github.com/thoughtbot/factory_bot/blob/master/LICENSE
87
+
92
88
 
93
89
  About thoughtbot
94
90
  ----------------
95
91
 
96
- ![thoughtbot](http://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg)
92
+ ![thoughtbot](https://thoughtbot.com/brand_assets/93:44.svg)
97
93
 
98
94
  factory_bot is maintained and funded by thoughtbot, inc.
99
95
  The names and logos for thoughtbot are trademarks of thoughtbot, inc.
@@ -103,4 +99,12 @@ See [our other projects][community] or
103
99
  [hire us][hire] to design, develop, and grow your product.
104
100
 
105
101
  [community]: https://thoughtbot.com/community?utm_source=github
106
- [hire]: https://thoughtbot.com?utm_source=github
102
+ [hire]: https://thoughtbot.com/hire-us?utm_source=github
103
+ [ci-image]: https://travis-ci.org/thoughtbot/factory_bot.svg
104
+ [ci]: https://travis-ci.org/thoughtbot/factory_bot?branch=master
105
+ [grade-image]: https://codeclimate.com/github/thoughtbot/factory_bot/badges/gpa.svg
106
+ [grade]: https://codeclimate.com/github/thoughtbot/factory_bot
107
+ [version-image]: https://badge.fury.io/rb/factory_bot.svg
108
+ [version]: https://badge.fury.io/rb/factory_bot
109
+ [hound-badge-image]: https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg
110
+ [hound]: https://houndci.com