factory_bot 5.1.1 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +52 -13
- data/GETTING_STARTED.md +426 -68
- data/NEWS.md +18 -1
- data/README.md +4 -4
- data/lib/factory_bot/aliases.rb +3 -3
- data/lib/factory_bot/attribute/association.rb +2 -2
- data/lib/factory_bot/attribute/dynamic.rb +2 -1
- data/lib/factory_bot/attribute_assigner.rb +9 -10
- data/lib/factory_bot/attribute_list.rb +1 -1
- data/lib/factory_bot/callback.rb +2 -10
- data/lib/factory_bot/configuration.rb +6 -6
- data/lib/factory_bot/declaration.rb +1 -1
- data/lib/factory_bot/declaration_list.rb +2 -2
- data/lib/factory_bot/decorator/invocation_tracker.rb +1 -1
- data/lib/factory_bot/decorator.rb +1 -1
- data/lib/factory_bot/definition.rb +42 -16
- data/lib/factory_bot/definition_hierarchy.rb +1 -11
- data/lib/factory_bot/definition_proxy.rb +64 -6
- data/lib/factory_bot/enum.rb +27 -0
- data/lib/factory_bot/evaluator.rb +5 -7
- data/lib/factory_bot/evaluator_class_definer.rb +1 -1
- data/lib/factory_bot/factory.rb +12 -12
- data/lib/factory_bot/factory_runner.rb +3 -3
- data/lib/factory_bot/find_definitions.rb +1 -1
- data/lib/factory_bot/internal.rb +18 -29
- data/lib/factory_bot/linter.rb +9 -13
- data/lib/factory_bot/null_factory.rb +10 -4
- data/lib/factory_bot/null_object.rb +2 -6
- data/lib/factory_bot/registry.rb +4 -4
- data/lib/factory_bot/reload.rb +0 -1
- data/lib/factory_bot/sequence.rb +5 -5
- data/lib/factory_bot/strategy/null.rb +4 -2
- data/lib/factory_bot/strategy/stub.rb +6 -2
- data/lib/factory_bot/strategy_syntax_method_registrar.rb +12 -1
- data/lib/factory_bot/syntax/default.rb +7 -19
- data/lib/factory_bot/trait.rb +1 -1
- data/lib/factory_bot/version.rb +1 -1
- data/lib/factory_bot.rb +21 -55
- metadata +12 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97d3a72c7d45c5c561f8c5ac318e8650d0f9787abeac65f598f06f0c04856727
|
4
|
+
data.tar.gz: 3afcae7ade56a0d0e1858e4205e4356efce894afd1a87370759bff3199439a07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3266e75f1419558703243a719bb837237f48b21757b4b6fd469a37340dcf426568238fea348a99f8b61402dc7f3fa8842bd9ea998850b701dfe7c64f47070ca
|
7
|
+
data.tar.gz: f411a10292c3a4b47ded4de7ed26f6e2d13a2a5d9ab49805eed4e7ffe1a27d44c61f345afa701cb25bdbfc4c12509006c702253039d7d9137aa13605a5652d51
|
data/CONTRIBUTING.md
CHANGED
@@ -12,7 +12,7 @@ Here are some ways *you* can contribute:
|
|
12
12
|
* by suggesting new features
|
13
13
|
* by writing or editing documentation
|
14
14
|
* by writing specifications
|
15
|
-
* by writing code ( **no patch is too small** : fix typos, add comments,
|
15
|
+
* by writing code ( **no patch is too small** : fix typos, add comments, etc. )
|
16
16
|
* by refactoring code
|
17
17
|
* by closing [issues][]
|
18
18
|
* by reviewing patches
|
@@ -23,13 +23,10 @@ Here are some ways *you* can contribute:
|
|
23
23
|
|
24
24
|
* We use the [GitHub issue tracker][issues] to track bugs and features.
|
25
25
|
* Before submitting a bug report or feature request, check to make sure it hasn't
|
26
|
-
already been submitted.
|
27
|
-
* When submitting a bug report, please include a [
|
28
|
-
|
29
|
-
|
30
|
-
should include a pull request with failing specs.
|
31
|
-
|
32
|
-
[gist]: https://gist.github.com/
|
26
|
+
already been submitted.
|
27
|
+
* When submitting a bug report, please include a [reproduction script] and any
|
28
|
+
other details that may be necessary to reproduce the bug, including your gem
|
29
|
+
version, Ruby version, and operating system.
|
33
30
|
|
34
31
|
## Cleaning up issues
|
35
32
|
|
@@ -40,21 +37,63 @@ already been submitted.
|
|
40
37
|
We will happily reopen the issue.
|
41
38
|
|
42
39
|
## Submitting a Pull Request
|
40
|
+
|
43
41
|
1. [Fork][fork] the [official repository][repo].
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
1. [Create a topic branch.][branch]
|
43
|
+
1. Implement your feature or bug fix.
|
44
|
+
1. Add, commit, and push your changes.
|
45
|
+
1. [Submit a pull request.][pr]
|
46
|
+
|
47
|
+
### Notes
|
48
48
|
|
49
|
-
## Notes
|
50
49
|
* Please add tests if you changed code. Contributions without tests won't be accepted.
|
51
50
|
* If you don't know how to add tests, please put in a PR and leave a comment
|
52
51
|
asking for help. We love helping!
|
53
52
|
* Please don't update the Gem version.
|
54
53
|
|
54
|
+
## Running the test suite
|
55
|
+
|
56
|
+
The default rake task will run the full test suite and [standard]:
|
57
|
+
|
58
|
+
```sh
|
59
|
+
bundle exec rake
|
60
|
+
```
|
61
|
+
|
62
|
+
You can also run a single group of tests (unit, spec, or feature)
|
63
|
+
|
64
|
+
```sh
|
65
|
+
bundle exec rake spec:unit
|
66
|
+
bundle exec rake spec:acceptance
|
67
|
+
bundle exec rake features
|
68
|
+
```
|
69
|
+
|
70
|
+
To run an individual rspec test, you can provide a path and line number:
|
71
|
+
|
72
|
+
```sh
|
73
|
+
bundle exec rspec spec/path/to/spec.rb:123
|
74
|
+
```
|
75
|
+
|
76
|
+
You can run tests with a specific version of rails via [appraisal]. To run
|
77
|
+
the default rake task against Rails 6, for example:
|
78
|
+
|
79
|
+
```sh
|
80
|
+
bundle exec appraisal 6.0 rake
|
81
|
+
```
|
82
|
+
|
83
|
+
## Formatting
|
84
|
+
|
85
|
+
Use [standard] to automatically format your code:
|
86
|
+
|
87
|
+
```sh
|
88
|
+
bundle exec rake standard:fix
|
89
|
+
```
|
90
|
+
|
55
91
|
[repo]: https://github.com/thoughtbot/factory_bot/tree/master
|
56
92
|
[fork]: https://help.github.com/articles/fork-a-repo/
|
57
93
|
[branch]: https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/
|
58
94
|
[pr]: https://help.github.com/articles/using-pull-requests/
|
95
|
+
[standard]: https://github.com/testdouble/standard
|
96
|
+
[appraisal]: https://github.com/thoughtbot/appraisal
|
97
|
+
[reproduction script]: https://github.com/thoughtbot/factory_bot/blob/master/.github/REPRODUCTION_SCRIPT.rb
|
59
98
|
|
60
99
|
Inspired by https://github.com/middleman/middleman-heroku/blob/master/CONTRIBUTING.md
|