factory_bot 4.8.2 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rspec +1 -0
- data/.travis.yml +22 -2
- data/Appraisals +4 -0
- data/GETTING_STARTED.md +24 -8
- data/Gemfile.lock +3 -3
- data/NAME.md +12 -5
- data/NEWS +5 -0
- data/README.md +7 -3
- data/gemfiles/3.2.gemfile +1 -1
- data/gemfiles/3.2.gemfile.lock +19 -17
- data/gemfiles/4.0.gemfile +1 -1
- data/gemfiles/4.0.gemfile.lock +19 -17
- data/gemfiles/4.1.gemfile +1 -1
- data/gemfiles/4.1.gemfile.lock +19 -17
- data/gemfiles/4.2.gemfile +1 -1
- data/gemfiles/4.2.gemfile.lock +19 -17
- data/gemfiles/5.0.gemfile +1 -1
- data/gemfiles/5.0.gemfile.lock +18 -17
- data/gemfiles/5.1.gemfile +10 -0
- data/gemfiles/5.1.gemfile.lock +104 -0
- data/lib/factory_bot.rb +4 -0
- data/lib/factory_bot/sequence.rb +9 -0
- data/lib/factory_bot/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3f6cddf8a7633587c40928e1b9bd981a644d0f2f99259eaafdd0ac986fa19775
|
4
|
+
data.tar.gz: 4300e1bc0e6204159ca66ef4ec2a3a9eb1cc131693b7907591e1a94f1f1e93f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9583c5fb81fd3be6241566123cc1ffa590f54cc58c441868aff8efb679405b2c52bf38fd8ca9c3a4bf89079d12505d64565161ff300fca3d186cfcafc3573dd6
|
7
|
+
data.tar.gz: 10723a4fdc450038aa2d515e3df7ff26d59d634439e6632daa44ba91f6ca87491f52edfb9c9595da8fd3621dda4a2b707dd8523c4eb42c156fda04411d75c332
|
data/.rspec
CHANGED
data/.travis.yml
CHANGED
@@ -2,8 +2,9 @@ rvm:
|
|
2
2
|
- 1.9.3
|
3
3
|
- 2.0.0
|
4
4
|
- 2.1.9
|
5
|
-
- 2.2.
|
6
|
-
- 2.3.
|
5
|
+
- 2.2.8
|
6
|
+
- 2.3.5
|
7
|
+
- 2.4.2
|
7
8
|
- ruby-head
|
8
9
|
- rbx-2
|
9
10
|
before_install:
|
@@ -18,15 +19,34 @@ gemfile:
|
|
18
19
|
- gemfiles/4.1.gemfile
|
19
20
|
- gemfiles/4.2.gemfile
|
20
21
|
- gemfiles/5.0.gemfile
|
22
|
+
- gemfiles/5.1.gemfile
|
21
23
|
matrix:
|
22
24
|
fast_finish: true
|
23
25
|
exclude:
|
24
26
|
- rvm: 1.9.3
|
25
27
|
gemfile: gemfiles/5.0.gemfile
|
28
|
+
- rvm: 1.9.3
|
29
|
+
gemfile: gemfiles/5.1.gemfile
|
26
30
|
- rvm: 2.0.0
|
27
31
|
gemfile: gemfiles/5.0.gemfile
|
32
|
+
- rvm: 2.0.0
|
33
|
+
gemfile: gemfiles/5.1.gemfile
|
28
34
|
- rvm: 2.1.9
|
29
35
|
gemfile: gemfiles/5.0.gemfile
|
36
|
+
- rvm: 2.1.9
|
37
|
+
gemfile: gemfiles/5.1.gemfile
|
38
|
+
- rvm: 2.4.2
|
39
|
+
gemfile: gemfiles/3.2.gemfile
|
40
|
+
- rvm: 2.4.2
|
41
|
+
gemfile: gemfiles/4.0.gemfile
|
42
|
+
- rvm: 2.4.2
|
43
|
+
gemfile: gemfiles/4.1.gemfile
|
44
|
+
- rvm: ruby-head
|
45
|
+
gemfile: gemfiles/3.2.gemfile
|
46
|
+
- rvm: ruby-head
|
47
|
+
gemfile: gemfiles/4.0.gemfile
|
48
|
+
- rvm: ruby-head
|
49
|
+
gemfile: gemfiles/4.1.gemfile
|
30
50
|
allow_failures:
|
31
51
|
- rvm: ruby-head
|
32
52
|
- rvm: rbx-2
|
data/Appraisals
CHANGED
data/GETTING_STARTED.md
CHANGED
@@ -28,7 +28,7 @@ Once your Gemfile is updated, you'll want to update your bundle.
|
|
28
28
|
Configure your test suite
|
29
29
|
-------------------------
|
30
30
|
|
31
|
-
|
31
|
+
### RSpec
|
32
32
|
|
33
33
|
```ruby
|
34
34
|
# spec/support/factory_bot.rb
|
@@ -52,7 +52,7 @@ Remember to require the above file in your rails_helper since the support folder
|
|
52
52
|
require 'support/factory_bot'
|
53
53
|
```
|
54
54
|
|
55
|
-
|
55
|
+
### Test::Unit
|
56
56
|
|
57
57
|
```ruby
|
58
58
|
class Test::Unit::TestCase
|
@@ -60,14 +60,14 @@ class Test::Unit::TestCase
|
|
60
60
|
end
|
61
61
|
```
|
62
62
|
|
63
|
-
|
63
|
+
### Cucumber
|
64
64
|
|
65
65
|
```ruby
|
66
66
|
# env.rb (Rails example location - RAILS_ROOT/features/support/env.rb)
|
67
67
|
World(FactoryBot::Syntax::Methods)
|
68
68
|
```
|
69
69
|
|
70
|
-
|
70
|
+
### Spinach
|
71
71
|
|
72
72
|
```ruby
|
73
73
|
class Spinach::FeatureSteps
|
@@ -75,7 +75,7 @@ class Spinach::FeatureSteps
|
|
75
75
|
end
|
76
76
|
```
|
77
77
|
|
78
|
-
|
78
|
+
### Minitest
|
79
79
|
|
80
80
|
```ruby
|
81
81
|
class Minitest::Unit::TestCase
|
@@ -83,7 +83,7 @@ class Minitest::Unit::TestCase
|
|
83
83
|
end
|
84
84
|
```
|
85
85
|
|
86
|
-
|
86
|
+
### Minitest::Spec
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
class Minitest::Spec
|
@@ -91,7 +91,7 @@ class Minitest::Spec
|
|
91
91
|
end
|
92
92
|
```
|
93
93
|
|
94
|
-
|
94
|
+
### minitest-rails
|
95
95
|
|
96
96
|
```ruby
|
97
97
|
class ActiveSupport::TestCase
|
@@ -572,6 +572,22 @@ end
|
|
572
572
|
|
573
573
|
The value just needs to support the `#next` method. Here the next value will be 'a', then 'b', etc.
|
574
574
|
|
575
|
+
Sequences can also be rewound with `FactoryBot.rewind_sequences`:
|
576
|
+
|
577
|
+
```ruby
|
578
|
+
sequence(:email) {|n| "person#{n}@example.com" }
|
579
|
+
|
580
|
+
generate(:email) # "person1@example.com"
|
581
|
+
generate(:email) # "person2@example.com"
|
582
|
+
generate(:email) # "person3@example.com"
|
583
|
+
|
584
|
+
FactoryBot.rewind_sequences
|
585
|
+
|
586
|
+
generate(:email) # "person1@example.com"
|
587
|
+
```
|
588
|
+
|
589
|
+
This rewinds all registered sequences.
|
590
|
+
|
575
591
|
Traits
|
576
592
|
------
|
577
593
|
|
@@ -991,7 +1007,7 @@ namespace :factory_bot do
|
|
991
1007
|
end
|
992
1008
|
else
|
993
1009
|
system("bundle exec rake factory_bot:lint RAILS_ENV='test'")
|
994
|
-
|
1010
|
+
fail if $?.exitstatus.nonzero?
|
995
1011
|
end
|
996
1012
|
end
|
997
1013
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
factory_bot (4.
|
4
|
+
factory_bot (4.10.0)
|
5
5
|
activesupport (>= 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -79,7 +79,7 @@ GEM
|
|
79
79
|
timecop (0.9.1)
|
80
80
|
tzinfo (1.2.3)
|
81
81
|
thread_safe (~> 0.1)
|
82
|
-
yard (0.9.
|
82
|
+
yard (0.9.12)
|
83
83
|
|
84
84
|
PLATFORMS
|
85
85
|
ruby
|
@@ -100,4 +100,4 @@ DEPENDENCIES
|
|
100
100
|
yard
|
101
101
|
|
102
102
|
BUNDLED WITH
|
103
|
-
1.
|
103
|
+
1.16.1
|
data/NAME.md
CHANGED
@@ -1,11 +1,18 @@
|
|
1
|
-
#
|
1
|
+
# Project Naming History
|
2
2
|
|
3
|
-
|
4
|
-
library.
|
3
|
+
## Factory Girl
|
5
4
|
|
6
|
-
|
7
|
-
|
5
|
+
This library was [initially released](https://robots.thoughtbot.com/waiting-for-a-factory-girl)
|
6
|
+
in 2008 with the name "Factory Girl".
|
7
|
+
|
8
|
+
We chose the name as a nod in the direction of the [Factory method](https://en.wikipedia.org/wiki/Factory_method_pattern)
|
8
9
|
and [Object Mother](http://martinfowler.com/bliki/ObjectMother.html) software
|
9
10
|
patterns from the _Design Patterns_ book, and as a reference to the
|
10
11
|
[Rolling Stones song](https://www.youtube.com/watch?v=4jKix2DFlnA) of the same
|
11
12
|
name.
|
13
|
+
|
14
|
+
## Factory Bot
|
15
|
+
|
16
|
+
The name "Factory Girl" was confusing to some developers who encountered this
|
17
|
+
library, and offensive or problematic to others. In October 2017 we [renamed the library](https://robots.thoughtbot.com/factory_bot)
|
18
|
+
to "Factory Bot".
|
data/NEWS
CHANGED
data/README.md
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
-
# factory_bot [](http://travis-ci.org/thoughtbot/factory_bot?branch=master) [](http://travis-ci.org/thoughtbot/factory_bot?branch=master) [](https://codeclimate.com/github/thoughtbot/factory_bot)
|
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
|
-
|
8
|
+
_[Interested in the history of the project name?](NAME.md)_
|
9
|
+
|
10
|
+
|
11
|
+
### Transitioning from factory\_girl?
|
12
|
+
|
13
|
+
Check out the [guide](https://github.com/thoughtbot/factory_bot/blob/4-9-0-stable/UPGRADE_FROM_FACTORY_GIRL.md).
|
9
14
|
|
10
|
-
_[Interested in the project name?](NAME.md)._
|
11
15
|
|
12
16
|
Documentation
|
13
17
|
-------------
|
data/gemfiles/3.2.gemfile
CHANGED
@@ -7,4 +7,4 @@ gem "jdbc-sqlite3", :platforms => :jruby
|
|
7
7
|
gem "sqlite3", "~> 1.3.10", :platforms => :ruby
|
8
8
|
gem "activerecord", :git => "https://github.com/rails/rails.git", :branch => "3-2-stable"
|
9
9
|
|
10
|
-
gemspec :
|
10
|
+
gemspec :name => "factory_bot", :path => "../"
|
data/gemfiles/3.2.gemfile.lock
CHANGED
@@ -16,9 +16,9 @@ GIT
|
|
16
16
|
multi_json (~> 1.0)
|
17
17
|
|
18
18
|
PATH
|
19
|
-
remote:
|
19
|
+
remote: ..
|
20
20
|
specs:
|
21
|
-
factory_bot (4.
|
21
|
+
factory_bot (4.10.0)
|
22
22
|
activesupport (>= 3.0.0)
|
23
23
|
|
24
24
|
GEM
|
@@ -39,6 +39,7 @@ GEM
|
|
39
39
|
builder (3.2.3)
|
40
40
|
childprocess (0.5.9)
|
41
41
|
ffi (~> 1.0, >= 1.0.11)
|
42
|
+
concurrent-ruby (1.0.5)
|
42
43
|
contracts (0.16.0)
|
43
44
|
cucumber (1.3.20)
|
44
45
|
builder (>= 2.1.2)
|
@@ -51,27 +52,28 @@ GEM
|
|
51
52
|
ffi (1.9.18)
|
52
53
|
gherkin (2.12.2)
|
53
54
|
multi_json (~> 1.3)
|
54
|
-
i18n (0.
|
55
|
+
i18n (0.9.1)
|
56
|
+
concurrent-ruby (~> 1.0)
|
55
57
|
json (2.1.0)
|
56
58
|
multi_json (1.12.2)
|
57
59
|
multi_test (0.1.2)
|
58
|
-
rake (12.1
|
59
|
-
rspec (3.
|
60
|
-
rspec-core (~> 3.
|
61
|
-
rspec-expectations (~> 3.
|
62
|
-
rspec-mocks (~> 3.
|
63
|
-
rspec-core (3.
|
64
|
-
rspec-support (~> 3.
|
65
|
-
rspec-expectations (3.
|
60
|
+
rake (12.2.1)
|
61
|
+
rspec (3.7.0)
|
62
|
+
rspec-core (~> 3.7.0)
|
63
|
+
rspec-expectations (~> 3.7.0)
|
64
|
+
rspec-mocks (~> 3.7.0)
|
65
|
+
rspec-core (3.7.0)
|
66
|
+
rspec-support (~> 3.7.0)
|
67
|
+
rspec-expectations (3.7.0)
|
66
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
-
rspec-support (~> 3.
|
69
|
+
rspec-support (~> 3.7.0)
|
68
70
|
rspec-its (1.2.0)
|
69
71
|
rspec-core (>= 3.0.0)
|
70
72
|
rspec-expectations (>= 3.0.0)
|
71
|
-
rspec-mocks (3.
|
73
|
+
rspec-mocks (3.7.0)
|
72
74
|
diff-lcs (>= 1.2.0, < 2.0)
|
73
|
-
rspec-support (~> 3.
|
74
|
-
rspec-support (3.
|
75
|
+
rspec-support (~> 3.7.0)
|
76
|
+
rspec-support (3.7.0)
|
75
77
|
simplecov (0.15.1)
|
76
78
|
docile (~> 1.1.0)
|
77
79
|
json (>= 1.8, < 3)
|
@@ -81,7 +83,7 @@ GEM
|
|
81
83
|
thor (0.20.0)
|
82
84
|
timecop (0.9.1)
|
83
85
|
tzinfo (0.3.53)
|
84
|
-
yard (0.9.
|
86
|
+
yard (0.9.12)
|
85
87
|
|
86
88
|
PLATFORMS
|
87
89
|
ruby
|
@@ -102,4 +104,4 @@ DEPENDENCIES
|
|
102
104
|
yard
|
103
105
|
|
104
106
|
BUNDLED WITH
|
105
|
-
1.
|
107
|
+
1.16.1
|
data/gemfiles/4.0.gemfile
CHANGED
data/gemfiles/4.0.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
|
-
remote:
|
2
|
+
remote: ..
|
3
3
|
specs:
|
4
|
-
factory_bot (4.
|
4
|
+
factory_bot (4.10.0)
|
5
5
|
activesupport (>= 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -37,6 +37,7 @@ GEM
|
|
37
37
|
builder (3.1.4)
|
38
38
|
childprocess (0.5.9)
|
39
39
|
ffi (~> 1.0, >= 1.0.11)
|
40
|
+
concurrent-ruby (1.0.5)
|
40
41
|
contracts (0.16.0)
|
41
42
|
cucumber (1.3.20)
|
42
43
|
builder (>= 2.1.2)
|
@@ -49,28 +50,29 @@ GEM
|
|
49
50
|
ffi (1.9.18)
|
50
51
|
gherkin (2.12.2)
|
51
52
|
multi_json (~> 1.3)
|
52
|
-
i18n (0.
|
53
|
+
i18n (0.9.1)
|
54
|
+
concurrent-ruby (~> 1.0)
|
53
55
|
json (2.1.0)
|
54
56
|
minitest (4.7.5)
|
55
57
|
multi_json (1.12.2)
|
56
58
|
multi_test (0.1.2)
|
57
|
-
rake (12.1
|
58
|
-
rspec (3.
|
59
|
-
rspec-core (~> 3.
|
60
|
-
rspec-expectations (~> 3.
|
61
|
-
rspec-mocks (~> 3.
|
62
|
-
rspec-core (3.
|
63
|
-
rspec-support (~> 3.
|
64
|
-
rspec-expectations (3.
|
59
|
+
rake (12.2.1)
|
60
|
+
rspec (3.7.0)
|
61
|
+
rspec-core (~> 3.7.0)
|
62
|
+
rspec-expectations (~> 3.7.0)
|
63
|
+
rspec-mocks (~> 3.7.0)
|
64
|
+
rspec-core (3.7.0)
|
65
|
+
rspec-support (~> 3.7.0)
|
66
|
+
rspec-expectations (3.7.0)
|
65
67
|
diff-lcs (>= 1.2.0, < 2.0)
|
66
|
-
rspec-support (~> 3.
|
68
|
+
rspec-support (~> 3.7.0)
|
67
69
|
rspec-its (1.2.0)
|
68
70
|
rspec-core (>= 3.0.0)
|
69
71
|
rspec-expectations (>= 3.0.0)
|
70
|
-
rspec-mocks (3.
|
72
|
+
rspec-mocks (3.7.0)
|
71
73
|
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
-
rspec-support (~> 3.
|
73
|
-
rspec-support (3.
|
74
|
+
rspec-support (~> 3.7.0)
|
75
|
+
rspec-support (3.7.0)
|
74
76
|
simplecov (0.15.1)
|
75
77
|
docile (~> 1.1.0)
|
76
78
|
json (>= 1.8, < 3)
|
@@ -81,7 +83,7 @@ GEM
|
|
81
83
|
thread_safe (0.3.6)
|
82
84
|
timecop (0.9.1)
|
83
85
|
tzinfo (0.3.53)
|
84
|
-
yard (0.9.
|
86
|
+
yard (0.9.12)
|
85
87
|
|
86
88
|
PLATFORMS
|
87
89
|
ruby
|
@@ -102,4 +104,4 @@ DEPENDENCIES
|
|
102
104
|
yard
|
103
105
|
|
104
106
|
BUNDLED WITH
|
105
|
-
1.
|
107
|
+
1.16.1
|
data/gemfiles/4.1.gemfile
CHANGED
data/gemfiles/4.1.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
|
-
remote:
|
2
|
+
remote: ..
|
3
3
|
specs:
|
4
|
-
factory_bot (4.
|
4
|
+
factory_bot (4.10.0)
|
5
5
|
activesupport (>= 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -35,6 +35,7 @@ GEM
|
|
35
35
|
builder (3.2.3)
|
36
36
|
childprocess (0.5.9)
|
37
37
|
ffi (~> 1.0, >= 1.0.11)
|
38
|
+
concurrent-ruby (1.0.5)
|
38
39
|
contracts (0.16.0)
|
39
40
|
cucumber (1.3.20)
|
40
41
|
builder (>= 2.1.2)
|
@@ -47,28 +48,29 @@ GEM
|
|
47
48
|
ffi (1.9.18)
|
48
49
|
gherkin (2.12.2)
|
49
50
|
multi_json (~> 1.3)
|
50
|
-
i18n (0.
|
51
|
+
i18n (0.9.1)
|
52
|
+
concurrent-ruby (~> 1.0)
|
51
53
|
json (1.8.6)
|
52
54
|
minitest (5.10.3)
|
53
55
|
multi_json (1.12.2)
|
54
56
|
multi_test (0.1.2)
|
55
|
-
rake (12.1
|
56
|
-
rspec (3.
|
57
|
-
rspec-core (~> 3.
|
58
|
-
rspec-expectations (~> 3.
|
59
|
-
rspec-mocks (~> 3.
|
60
|
-
rspec-core (3.
|
61
|
-
rspec-support (~> 3.
|
62
|
-
rspec-expectations (3.
|
57
|
+
rake (12.2.1)
|
58
|
+
rspec (3.7.0)
|
59
|
+
rspec-core (~> 3.7.0)
|
60
|
+
rspec-expectations (~> 3.7.0)
|
61
|
+
rspec-mocks (~> 3.7.0)
|
62
|
+
rspec-core (3.7.0)
|
63
|
+
rspec-support (~> 3.7.0)
|
64
|
+
rspec-expectations (3.7.0)
|
63
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
-
rspec-support (~> 3.
|
66
|
+
rspec-support (~> 3.7.0)
|
65
67
|
rspec-its (1.2.0)
|
66
68
|
rspec-core (>= 3.0.0)
|
67
69
|
rspec-expectations (>= 3.0.0)
|
68
|
-
rspec-mocks (3.
|
70
|
+
rspec-mocks (3.7.0)
|
69
71
|
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
-
rspec-support (~> 3.
|
71
|
-
rspec-support (3.
|
72
|
+
rspec-support (~> 3.7.0)
|
73
|
+
rspec-support (3.7.0)
|
72
74
|
simplecov (0.15.1)
|
73
75
|
docile (~> 1.1.0)
|
74
76
|
json (>= 1.8, < 3)
|
@@ -80,7 +82,7 @@ GEM
|
|
80
82
|
timecop (0.9.1)
|
81
83
|
tzinfo (1.2.3)
|
82
84
|
thread_safe (~> 0.1)
|
83
|
-
yard (0.9.
|
85
|
+
yard (0.9.12)
|
84
86
|
|
85
87
|
PLATFORMS
|
86
88
|
ruby
|
@@ -101,4 +103,4 @@ DEPENDENCIES
|
|
101
103
|
yard
|
102
104
|
|
103
105
|
BUNDLED WITH
|
104
|
-
1.
|
106
|
+
1.16.1
|
data/gemfiles/4.2.gemfile
CHANGED
data/gemfiles/4.2.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
|
-
remote:
|
2
|
+
remote: ..
|
3
3
|
specs:
|
4
|
-
factory_bot (4.
|
4
|
+
factory_bot (4.10.0)
|
5
5
|
activesupport (>= 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -35,6 +35,7 @@ GEM
|
|
35
35
|
builder (3.2.3)
|
36
36
|
childprocess (0.5.9)
|
37
37
|
ffi (~> 1.0, >= 1.0.11)
|
38
|
+
concurrent-ruby (1.0.5)
|
38
39
|
contracts (0.16.0)
|
39
40
|
cucumber (1.3.20)
|
40
41
|
builder (>= 2.1.2)
|
@@ -47,28 +48,29 @@ GEM
|
|
47
48
|
ffi (1.9.18)
|
48
49
|
gherkin (2.12.2)
|
49
50
|
multi_json (~> 1.3)
|
50
|
-
i18n (0.
|
51
|
+
i18n (0.9.1)
|
52
|
+
concurrent-ruby (~> 1.0)
|
51
53
|
json (1.8.6)
|
52
54
|
minitest (5.10.3)
|
53
55
|
multi_json (1.12.2)
|
54
56
|
multi_test (0.1.2)
|
55
|
-
rake (12.1
|
56
|
-
rspec (3.
|
57
|
-
rspec-core (~> 3.
|
58
|
-
rspec-expectations (~> 3.
|
59
|
-
rspec-mocks (~> 3.
|
60
|
-
rspec-core (3.
|
61
|
-
rspec-support (~> 3.
|
62
|
-
rspec-expectations (3.
|
57
|
+
rake (12.2.1)
|
58
|
+
rspec (3.7.0)
|
59
|
+
rspec-core (~> 3.7.0)
|
60
|
+
rspec-expectations (~> 3.7.0)
|
61
|
+
rspec-mocks (~> 3.7.0)
|
62
|
+
rspec-core (3.7.0)
|
63
|
+
rspec-support (~> 3.7.0)
|
64
|
+
rspec-expectations (3.7.0)
|
63
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
-
rspec-support (~> 3.
|
66
|
+
rspec-support (~> 3.7.0)
|
65
67
|
rspec-its (1.2.0)
|
66
68
|
rspec-core (>= 3.0.0)
|
67
69
|
rspec-expectations (>= 3.0.0)
|
68
|
-
rspec-mocks (3.
|
70
|
+
rspec-mocks (3.7.0)
|
69
71
|
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
-
rspec-support (~> 3.
|
71
|
-
rspec-support (3.
|
72
|
+
rspec-support (~> 3.7.0)
|
73
|
+
rspec-support (3.7.0)
|
72
74
|
simplecov (0.15.1)
|
73
75
|
docile (~> 1.1.0)
|
74
76
|
json (>= 1.8, < 3)
|
@@ -80,7 +82,7 @@ GEM
|
|
80
82
|
timecop (0.9.1)
|
81
83
|
tzinfo (1.2.3)
|
82
84
|
thread_safe (~> 0.1)
|
83
|
-
yard (0.9.
|
85
|
+
yard (0.9.12)
|
84
86
|
|
85
87
|
PLATFORMS
|
86
88
|
ruby
|
@@ -101,4 +103,4 @@ DEPENDENCIES
|
|
101
103
|
yard
|
102
104
|
|
103
105
|
BUNDLED WITH
|
104
|
-
1.
|
106
|
+
1.16.1
|
data/gemfiles/5.0.gemfile
CHANGED
data/gemfiles/5.0.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
|
-
remote:
|
2
|
+
remote: ..
|
3
3
|
specs:
|
4
|
-
factory_bot (4.
|
4
|
+
factory_bot (4.10.0)
|
5
5
|
activesupport (>= 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -46,28 +46,29 @@ GEM
|
|
46
46
|
ffi (1.9.18)
|
47
47
|
gherkin (2.12.2)
|
48
48
|
multi_json (~> 1.3)
|
49
|
-
i18n (0.
|
49
|
+
i18n (0.9.1)
|
50
|
+
concurrent-ruby (~> 1.0)
|
50
51
|
json (2.1.0)
|
51
52
|
minitest (5.10.3)
|
52
53
|
multi_json (1.12.2)
|
53
54
|
multi_test (0.1.2)
|
54
|
-
rake (12.
|
55
|
-
rspec (3.
|
56
|
-
rspec-core (~> 3.
|
57
|
-
rspec-expectations (~> 3.
|
58
|
-
rspec-mocks (~> 3.
|
59
|
-
rspec-core (3.
|
60
|
-
rspec-support (~> 3.
|
61
|
-
rspec-expectations (3.
|
55
|
+
rake (12.3.0)
|
56
|
+
rspec (3.7.0)
|
57
|
+
rspec-core (~> 3.7.0)
|
58
|
+
rspec-expectations (~> 3.7.0)
|
59
|
+
rspec-mocks (~> 3.7.0)
|
60
|
+
rspec-core (3.7.0)
|
61
|
+
rspec-support (~> 3.7.0)
|
62
|
+
rspec-expectations (3.7.0)
|
62
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
63
|
-
rspec-support (~> 3.
|
64
|
+
rspec-support (~> 3.7.0)
|
64
65
|
rspec-its (1.2.0)
|
65
66
|
rspec-core (>= 3.0.0)
|
66
67
|
rspec-expectations (>= 3.0.0)
|
67
|
-
rspec-mocks (3.
|
68
|
+
rspec-mocks (3.7.0)
|
68
69
|
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
-
rspec-support (~> 3.
|
70
|
-
rspec-support (3.
|
70
|
+
rspec-support (~> 3.7.0)
|
71
|
+
rspec-support (3.7.0)
|
71
72
|
simplecov (0.15.1)
|
72
73
|
docile (~> 1.1.0)
|
73
74
|
json (>= 1.8, < 3)
|
@@ -79,7 +80,7 @@ GEM
|
|
79
80
|
timecop (0.9.1)
|
80
81
|
tzinfo (1.2.3)
|
81
82
|
thread_safe (~> 0.1)
|
82
|
-
yard (0.9.
|
83
|
+
yard (0.9.12)
|
83
84
|
|
84
85
|
PLATFORMS
|
85
86
|
ruby
|
@@ -100,4 +101,4 @@ DEPENDENCIES
|
|
100
101
|
yard
|
101
102
|
|
102
103
|
BUNDLED WITH
|
103
|
-
1.
|
104
|
+
1.16.1
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
6
|
+
gem "jdbc-sqlite3", :platforms => :jruby
|
7
|
+
gem "sqlite3", "~> 1.3.10", :platforms => :ruby
|
8
|
+
gem "activerecord", "~> 5.1.0"
|
9
|
+
|
10
|
+
gemspec :name => "factory_bot", :path => "../"
|
@@ -0,0 +1,104 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
factory_bot (4.10.0)
|
5
|
+
activesupport (>= 3.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (5.1.4)
|
11
|
+
activesupport (= 5.1.4)
|
12
|
+
activerecord (5.1.4)
|
13
|
+
activemodel (= 5.1.4)
|
14
|
+
activesupport (= 5.1.4)
|
15
|
+
arel (~> 8.0)
|
16
|
+
activesupport (5.1.4)
|
17
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
|
+
i18n (~> 0.7)
|
19
|
+
minitest (~> 5.1)
|
20
|
+
tzinfo (~> 1.1)
|
21
|
+
appraisal (2.1.0)
|
22
|
+
bundler
|
23
|
+
rake
|
24
|
+
thor (>= 0.14.0)
|
25
|
+
arel (8.0.0)
|
26
|
+
aruba (0.14.2)
|
27
|
+
childprocess (~> 0.5.6)
|
28
|
+
contracts (~> 0.9)
|
29
|
+
cucumber (>= 1.3.19)
|
30
|
+
ffi (~> 1.9.10)
|
31
|
+
rspec-expectations (>= 2.99)
|
32
|
+
thor (~> 0.19)
|
33
|
+
builder (3.2.3)
|
34
|
+
childprocess (0.5.9)
|
35
|
+
ffi (~> 1.0, >= 1.0.11)
|
36
|
+
concurrent-ruby (1.0.5)
|
37
|
+
contracts (0.16.0)
|
38
|
+
cucumber (1.3.20)
|
39
|
+
builder (>= 2.1.2)
|
40
|
+
diff-lcs (>= 1.1.3)
|
41
|
+
gherkin (~> 2.12)
|
42
|
+
multi_json (>= 1.7.5, < 2.0)
|
43
|
+
multi_test (>= 0.1.2)
|
44
|
+
diff-lcs (1.3)
|
45
|
+
docile (1.1.5)
|
46
|
+
ffi (1.9.18)
|
47
|
+
gherkin (2.12.2)
|
48
|
+
multi_json (~> 1.3)
|
49
|
+
i18n (0.9.1)
|
50
|
+
concurrent-ruby (~> 1.0)
|
51
|
+
json (2.1.0)
|
52
|
+
minitest (5.10.3)
|
53
|
+
multi_json (1.12.2)
|
54
|
+
multi_test (0.1.2)
|
55
|
+
rake (12.3.0)
|
56
|
+
rspec (3.7.0)
|
57
|
+
rspec-core (~> 3.7.0)
|
58
|
+
rspec-expectations (~> 3.7.0)
|
59
|
+
rspec-mocks (~> 3.7.0)
|
60
|
+
rspec-core (3.7.0)
|
61
|
+
rspec-support (~> 3.7.0)
|
62
|
+
rspec-expectations (3.7.0)
|
63
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
+
rspec-support (~> 3.7.0)
|
65
|
+
rspec-its (1.2.0)
|
66
|
+
rspec-core (>= 3.0.0)
|
67
|
+
rspec-expectations (>= 3.0.0)
|
68
|
+
rspec-mocks (3.7.0)
|
69
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
+
rspec-support (~> 3.7.0)
|
71
|
+
rspec-support (3.7.0)
|
72
|
+
simplecov (0.15.1)
|
73
|
+
docile (~> 1.1.0)
|
74
|
+
json (>= 1.8, < 3)
|
75
|
+
simplecov-html (~> 0.10.0)
|
76
|
+
simplecov-html (0.10.2)
|
77
|
+
sqlite3 (1.3.13)
|
78
|
+
thor (0.20.0)
|
79
|
+
thread_safe (0.3.6)
|
80
|
+
timecop (0.9.1)
|
81
|
+
tzinfo (1.2.3)
|
82
|
+
thread_safe (~> 0.1)
|
83
|
+
yard (0.9.12)
|
84
|
+
|
85
|
+
PLATFORMS
|
86
|
+
ruby
|
87
|
+
|
88
|
+
DEPENDENCIES
|
89
|
+
activerecord (~> 5.1.0)
|
90
|
+
activerecord-jdbcsqlite3-adapter
|
91
|
+
appraisal (~> 2.1.0)
|
92
|
+
aruba
|
93
|
+
cucumber (~> 1.3.15)
|
94
|
+
factory_bot!
|
95
|
+
jdbc-sqlite3
|
96
|
+
rspec (~> 3.0)
|
97
|
+
rspec-its (~> 1.0)
|
98
|
+
simplecov
|
99
|
+
sqlite3 (~> 1.3.10)
|
100
|
+
timecop
|
101
|
+
yard
|
102
|
+
|
103
|
+
BUNDLED WITH
|
104
|
+
1.16.1
|
data/lib/factory_bot.rb
CHANGED
data/lib/factory_bot/sequence.rb
CHANGED
@@ -35,6 +35,10 @@ module FactoryBot
|
|
35
35
|
[@name] + @aliases
|
36
36
|
end
|
37
37
|
|
38
|
+
def rewind
|
39
|
+
@value.rewind
|
40
|
+
end
|
41
|
+
|
38
42
|
private
|
39
43
|
|
40
44
|
def value
|
@@ -47,6 +51,7 @@ module FactoryBot
|
|
47
51
|
|
48
52
|
class EnumeratorAdapter
|
49
53
|
def initialize(value)
|
54
|
+
@first_value = value
|
50
55
|
@value = value
|
51
56
|
end
|
52
57
|
|
@@ -57,6 +62,10 @@ module FactoryBot
|
|
57
62
|
def next
|
58
63
|
@value = @value.next
|
59
64
|
end
|
65
|
+
|
66
|
+
def rewind
|
67
|
+
@value = @first_value
|
68
|
+
end
|
60
69
|
end
|
61
70
|
end
|
62
71
|
end
|
data/lib/factory_bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Clayton
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-05-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -191,6 +191,8 @@ files:
|
|
191
191
|
- gemfiles/4.2.gemfile.lock
|
192
192
|
- gemfiles/5.0.gemfile
|
193
193
|
- gemfiles/5.0.gemfile.lock
|
194
|
+
- gemfiles/5.1.gemfile
|
195
|
+
- gemfiles/5.1.gemfile.lock
|
194
196
|
- lib/factory_bot.rb
|
195
197
|
- lib/factory_bot/aliases.rb
|
196
198
|
- lib/factory_bot/attribute.rb
|
@@ -265,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
267
|
version: '0'
|
266
268
|
requirements: []
|
267
269
|
rubyforge_project:
|
268
|
-
rubygems_version: 2.6
|
270
|
+
rubygems_version: 2.7.6
|
269
271
|
signing_key:
|
270
272
|
specification_version: 4
|
271
273
|
summary: factory_bot provides a framework and DSL for defining and using model instance
|