factory_girl 4.2.0 → 4.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +29 -7
- data/.yardopts +1 -1
- data/Appraisals +12 -8
- data/CONTRIBUTING.md +60 -0
- data/GETTING_STARTED.md +473 -191
- data/Gemfile +6 -3
- data/Gemfile.lock +93 -65
- data/LICENSE +1 -1
- data/NAME.md +11 -0
- data/NEWS +43 -1
- data/README.md +52 -28
- data/Rakefile +1 -3
- data/factory_girl.gemspec +9 -17
- data/gemfiles/3.2.gemfile +6 -3
- data/gemfiles/3.2.gemfile.lock +85 -62
- data/gemfiles/4.0.gemfile +6 -3
- data/gemfiles/4.0.gemfile.lock +84 -74
- data/gemfiles/4.1.gemfile +10 -0
- data/gemfiles/4.1.gemfile.lock +104 -0
- data/gemfiles/4.2.gemfile +10 -0
- data/gemfiles/4.2.gemfile.lock +104 -0
- data/gemfiles/5.0.gemfile +10 -0
- data/gemfiles/5.0.gemfile.lock +103 -0
- data/lib/factory_girl/attribute/dynamic.rb +4 -1
- data/lib/factory_girl/attribute_assigner.rb +4 -4
- data/lib/factory_girl/attribute_list.rb +1 -1
- data/lib/factory_girl/callback.rb +1 -1
- data/lib/factory_girl/callbacks_observer.rb +1 -1
- data/lib/factory_girl/configuration.rb +7 -2
- data/lib/factory_girl/declaration_list.rb +2 -2
- data/lib/factory_girl/decorator/attribute_hash.rb +1 -2
- data/lib/factory_girl/decorator/class_key_hash.rb +2 -1
- data/lib/factory_girl/decorator.rb +2 -2
- data/lib/factory_girl/definition.rb +25 -15
- data/lib/factory_girl/definition_hierarchy.rb +1 -1
- data/lib/factory_girl/definition_proxy.rb +15 -17
- data/lib/factory_girl/errors.rb +6 -0
- data/lib/factory_girl/evaluator.rb +7 -1
- data/lib/factory_girl/factory.rb +3 -3
- data/lib/factory_girl/factory_runner.rb +7 -1
- data/lib/factory_girl/find_definitions.rb +3 -3
- data/lib/factory_girl/linter.rb +97 -0
- data/lib/factory_girl/strategy/stub.rb +58 -20
- data/lib/factory_girl/strategy_syntax_method_registrar.rb +17 -0
- data/lib/factory_girl/syntax/default.rb +8 -0
- data/lib/factory_girl/syntax/methods.rb +18 -2
- data/lib/factory_girl/version.rb +1 -1
- data/lib/factory_girl.rb +30 -3
- metadata +65 -249
- data/CONTRIBUTION_GUIDELINES.md +0 -10
- data/features/find_definitions.feature +0 -75
- data/features/step_definitions/database_steps.rb +0 -9
- data/features/step_definitions/factory_girl_steps.rb +0 -36
- data/features/support/env.rb +0 -10
- data/features/support/factories.rb +0 -16
- data/gemfiles/3.0.gemfile +0 -7
- data/gemfiles/3.0.gemfile.lock +0 -81
- data/gemfiles/3.1.gemfile +0 -7
- data/gemfiles/3.1.gemfile.lock +0 -82
- data/spec/acceptance/activesupport_instrumentation_spec.rb +0 -62
- data/spec/acceptance/aliases_spec.rb +0 -19
- data/spec/acceptance/attribute_aliases_spec.rb +0 -45
- data/spec/acceptance/attribute_existing_on_object_spec.rb +0 -68
- data/spec/acceptance/attributes_for_spec.rb +0 -97
- data/spec/acceptance/attributes_from_instance_spec.rb +0 -53
- data/spec/acceptance/attributes_ordered_spec.rb +0 -51
- data/spec/acceptance/build_list_spec.rb +0 -56
- data/spec/acceptance/build_spec.rb +0 -86
- data/spec/acceptance/build_stubbed_spec.rb +0 -161
- data/spec/acceptance/callbacks_spec.rb +0 -177
- data/spec/acceptance/create_list_spec.rb +0 -97
- data/spec/acceptance/create_spec.rb +0 -116
- data/spec/acceptance/define_child_before_parent_spec.rb +0 -21
- data/spec/acceptance/definition_spec.rb +0 -21
- data/spec/acceptance/definition_without_block_spec.rb +0 -15
- data/spec/acceptance/global_initialize_with_spec.rb +0 -82
- data/spec/acceptance/global_to_create_spec.rb +0 -122
- data/spec/acceptance/initialize_with_spec.rb +0 -217
- data/spec/acceptance/keyed_by_class_spec.rb +0 -22
- data/spec/acceptance/modify_factories_spec.rb +0 -184
- data/spec/acceptance/modify_inherited_spec.rb +0 -52
- data/spec/acceptance/nested_attributes_spec.rb +0 -32
- data/spec/acceptance/overrides_spec.rb +0 -61
- data/spec/acceptance/parent_spec.rb +0 -90
- data/spec/acceptance/register_strategies_spec.rb +0 -128
- data/spec/acceptance/sequence_context_spec.rb +0 -52
- data/spec/acceptance/sequence_spec.rb +0 -61
- data/spec/acceptance/skip_create_spec.rb +0 -19
- data/spec/acceptance/stub_spec.rb +0 -62
- data/spec/acceptance/syntax_methods_within_dynamic_attributes_spec.rb +0 -41
- data/spec/acceptance/traits_spec.rb +0 -727
- data/spec/acceptance/transient_attributes_spec.rb +0 -124
- data/spec/factory_girl/aliases_spec.rb +0 -31
- data/spec/factory_girl/attribute/association_spec.rb +0 -28
- data/spec/factory_girl/attribute/dynamic_spec.rb +0 -52
- data/spec/factory_girl/attribute/sequence_spec.rb +0 -16
- data/spec/factory_girl/attribute/static_spec.rb +0 -19
- data/spec/factory_girl/attribute_list_spec.rb +0 -143
- data/spec/factory_girl/attribute_spec.rb +0 -16
- data/spec/factory_girl/callback_spec.rb +0 -41
- data/spec/factory_girl/declaration/implicit_spec.rb +0 -25
- data/spec/factory_girl/declaration_list_spec.rb +0 -67
- data/spec/factory_girl/definition_proxy_spec.rb +0 -215
- data/spec/factory_girl/definition_spec.rb +0 -58
- data/spec/factory_girl/disallows_duplicates_registry_spec.rb +0 -19
- data/spec/factory_girl/evaluator_class_definer_spec.rb +0 -77
- data/spec/factory_girl/factory_spec.rb +0 -259
- data/spec/factory_girl/find_definitions_spec.rb +0 -110
- data/spec/factory_girl/null_factory_spec.rb +0 -13
- data/spec/factory_girl/null_object_spec.rb +0 -22
- data/spec/factory_girl/registry_spec.rb +0 -68
- data/spec/factory_girl/sequence_spec.rb +0 -95
- data/spec/factory_girl/strategy/attributes_for_spec.rb +0 -18
- data/spec/factory_girl/strategy/build_spec.rb +0 -7
- data/spec/factory_girl/strategy/create_spec.rb +0 -25
- data/spec/factory_girl/strategy/stub_spec.rb +0 -38
- data/spec/factory_girl/strategy_calculator_spec.rb +0 -29
- data/spec/factory_girl_spec.rb +0 -22
- data/spec/spec_helper.rb +0 -26
- data/spec/support/macros/define_constant.rb +0 -86
- data/spec/support/matchers/callback.rb +0 -9
- data/spec/support/matchers/declaration.rb +0 -83
- data/spec/support/matchers/delegate.rb +0 -44
- data/spec/support/matchers/trait.rb +0 -9
- data/spec/support/shared_examples/strategy.rb +0 -90
data/gemfiles/4.0.gemfile.lock
CHANGED
@@ -1,95 +1,105 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/rails/rails.git
|
3
|
-
revision: 40e797827935756aacf0463e4b44e1c1c92b0aeb
|
4
|
-
specs:
|
5
|
-
activemodel (4.0.0.beta)
|
6
|
-
activesupport (= 4.0.0.beta)
|
7
|
-
builder (~> 3.1.0)
|
8
|
-
activerecord (4.0.0.beta)
|
9
|
-
activemodel (= 4.0.0.beta)
|
10
|
-
activerecord-deprecated_finders (= 0.0.2)
|
11
|
-
activesupport (= 4.0.0.beta)
|
12
|
-
arel (~> 3.0.2)
|
13
|
-
activesupport (4.0.0.beta)
|
14
|
-
i18n (~> 0.6)
|
15
|
-
minitest (~> 4.1)
|
16
|
-
multi_json (~> 1.3)
|
17
|
-
thread_safe (~> 0.1)
|
18
|
-
tzinfo (~> 0.3.33)
|
19
|
-
|
20
1
|
PATH
|
21
|
-
remote:
|
2
|
+
remote: ../
|
22
3
|
specs:
|
23
|
-
factory_girl (4.
|
4
|
+
factory_girl (4.8.1)
|
24
5
|
activesupport (>= 3.0.0)
|
25
6
|
|
26
7
|
GEM
|
27
|
-
remote:
|
8
|
+
remote: https://rubygems.org/
|
28
9
|
specs:
|
29
|
-
|
30
|
-
|
10
|
+
activemodel (4.0.13)
|
11
|
+
activesupport (= 4.0.13)
|
12
|
+
builder (~> 3.1.0)
|
13
|
+
activerecord (4.0.13)
|
14
|
+
activemodel (= 4.0.13)
|
15
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
16
|
+
activesupport (= 4.0.13)
|
17
|
+
arel (~> 4.0.0)
|
18
|
+
activerecord-deprecated_finders (1.0.4)
|
19
|
+
activesupport (4.0.13)
|
20
|
+
i18n (~> 0.6, >= 0.6.9)
|
21
|
+
minitest (~> 4.2)
|
22
|
+
multi_json (~> 1.3)
|
23
|
+
thread_safe (~> 0.1)
|
24
|
+
tzinfo (~> 0.3.37)
|
25
|
+
appraisal (2.1.0)
|
31
26
|
bundler
|
32
27
|
rake
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
28
|
+
thor (>= 0.14.0)
|
29
|
+
arel (4.0.2)
|
30
|
+
aruba (0.14.2)
|
31
|
+
childprocess (~> 0.5.6)
|
32
|
+
contracts (~> 0.9)
|
33
|
+
cucumber (>= 1.3.19)
|
34
|
+
ffi (~> 1.9.10)
|
35
|
+
rspec-expectations (>= 2.99)
|
36
|
+
thor (~> 0.19)
|
41
37
|
builder (3.1.4)
|
42
|
-
childprocess (0.
|
43
|
-
ffi (~> 1.0, >= 1.0.
|
44
|
-
|
38
|
+
childprocess (0.5.9)
|
39
|
+
ffi (~> 1.0, >= 1.0.11)
|
40
|
+
contracts (0.16.0)
|
41
|
+
cucumber (1.3.20)
|
45
42
|
builder (>= 2.1.2)
|
46
43
|
diff-lcs (>= 1.1.3)
|
47
|
-
gherkin (~> 2.
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
rake (
|
61
|
-
rspec (
|
62
|
-
rspec-core (~>
|
63
|
-
rspec-expectations (~>
|
64
|
-
rspec-mocks (~>
|
65
|
-
rspec-core (
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
44
|
+
gherkin (~> 2.12)
|
45
|
+
multi_json (>= 1.7.5, < 2.0)
|
46
|
+
multi_test (>= 0.1.2)
|
47
|
+
diff-lcs (1.3)
|
48
|
+
docile (1.1.5)
|
49
|
+
ffi (1.9.18)
|
50
|
+
gherkin (2.12.2)
|
51
|
+
multi_json (~> 1.3)
|
52
|
+
i18n (0.8.6)
|
53
|
+
json (2.1.0)
|
54
|
+
minitest (4.7.5)
|
55
|
+
multi_json (1.12.2)
|
56
|
+
multi_test (0.1.2)
|
57
|
+
rake (12.1.0)
|
58
|
+
rspec (3.6.0)
|
59
|
+
rspec-core (~> 3.6.0)
|
60
|
+
rspec-expectations (~> 3.6.0)
|
61
|
+
rspec-mocks (~> 3.6.0)
|
62
|
+
rspec-core (3.6.0)
|
63
|
+
rspec-support (~> 3.6.0)
|
64
|
+
rspec-expectations (3.6.0)
|
65
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
66
|
+
rspec-support (~> 3.6.0)
|
67
|
+
rspec-its (1.2.0)
|
68
|
+
rspec-core (>= 3.0.0)
|
69
|
+
rspec-expectations (>= 3.0.0)
|
70
|
+
rspec-mocks (3.6.0)
|
71
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
+
rspec-support (~> 3.6.0)
|
73
|
+
rspec-support (3.6.0)
|
74
|
+
simplecov (0.15.1)
|
75
|
+
docile (~> 1.1.0)
|
76
|
+
json (>= 1.8, < 3)
|
77
|
+
simplecov-html (~> 0.10.0)
|
78
|
+
simplecov-html (0.10.2)
|
79
|
+
sqlite3 (1.3.13)
|
80
|
+
thor (0.20.0)
|
81
|
+
thread_safe (0.3.6)
|
82
|
+
timecop (0.9.1)
|
83
|
+
tzinfo (0.3.53)
|
84
|
+
yard (0.9.9)
|
79
85
|
|
80
86
|
PLATFORMS
|
81
87
|
ruby
|
82
88
|
|
83
89
|
DEPENDENCIES
|
84
|
-
activerecord
|
85
|
-
|
90
|
+
activerecord (~> 4.0.13)
|
91
|
+
activerecord-jdbcsqlite3-adapter
|
92
|
+
appraisal (~> 2.1.0)
|
86
93
|
aruba
|
87
|
-
|
88
|
-
cucumber (~> 1.2.1)
|
94
|
+
cucumber (~> 1.3.15)
|
89
95
|
factory_girl!
|
90
|
-
|
91
|
-
rspec (~>
|
96
|
+
jdbc-sqlite3
|
97
|
+
rspec (~> 3.0)
|
98
|
+
rspec-its (~> 1.0)
|
92
99
|
simplecov
|
93
|
-
sqlite3
|
100
|
+
sqlite3 (~> 1.3.10)
|
94
101
|
timecop
|
95
102
|
yard
|
103
|
+
|
104
|
+
BUNDLED WITH
|
105
|
+
1.15.4
|
@@ -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", "~> 4.1.14"
|
9
|
+
|
10
|
+
gemspec :path => "../"
|
@@ -0,0 +1,104 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
factory_girl (4.8.1)
|
5
|
+
activesupport (>= 3.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (4.1.16)
|
11
|
+
activesupport (= 4.1.16)
|
12
|
+
builder (~> 3.1)
|
13
|
+
activerecord (4.1.16)
|
14
|
+
activemodel (= 4.1.16)
|
15
|
+
activesupport (= 4.1.16)
|
16
|
+
arel (~> 5.0.0)
|
17
|
+
activesupport (4.1.16)
|
18
|
+
i18n (~> 0.6, >= 0.6.9)
|
19
|
+
json (~> 1.7, >= 1.7.7)
|
20
|
+
minitest (~> 5.1)
|
21
|
+
thread_safe (~> 0.1)
|
22
|
+
tzinfo (~> 1.1)
|
23
|
+
appraisal (2.1.0)
|
24
|
+
bundler
|
25
|
+
rake
|
26
|
+
thor (>= 0.14.0)
|
27
|
+
arel (5.0.1.20140414130214)
|
28
|
+
aruba (0.14.2)
|
29
|
+
childprocess (~> 0.5.6)
|
30
|
+
contracts (~> 0.9)
|
31
|
+
cucumber (>= 1.3.19)
|
32
|
+
ffi (~> 1.9.10)
|
33
|
+
rspec-expectations (>= 2.99)
|
34
|
+
thor (~> 0.19)
|
35
|
+
builder (3.2.3)
|
36
|
+
childprocess (0.5.9)
|
37
|
+
ffi (~> 1.0, >= 1.0.11)
|
38
|
+
contracts (0.16.0)
|
39
|
+
cucumber (1.3.20)
|
40
|
+
builder (>= 2.1.2)
|
41
|
+
diff-lcs (>= 1.1.3)
|
42
|
+
gherkin (~> 2.12)
|
43
|
+
multi_json (>= 1.7.5, < 2.0)
|
44
|
+
multi_test (>= 0.1.2)
|
45
|
+
diff-lcs (1.3)
|
46
|
+
docile (1.1.5)
|
47
|
+
ffi (1.9.18)
|
48
|
+
gherkin (2.12.2)
|
49
|
+
multi_json (~> 1.3)
|
50
|
+
i18n (0.8.6)
|
51
|
+
json (1.8.6)
|
52
|
+
minitest (5.10.3)
|
53
|
+
multi_json (1.12.2)
|
54
|
+
multi_test (0.1.2)
|
55
|
+
rake (12.1.0)
|
56
|
+
rspec (3.6.0)
|
57
|
+
rspec-core (~> 3.6.0)
|
58
|
+
rspec-expectations (~> 3.6.0)
|
59
|
+
rspec-mocks (~> 3.6.0)
|
60
|
+
rspec-core (3.6.0)
|
61
|
+
rspec-support (~> 3.6.0)
|
62
|
+
rspec-expectations (3.6.0)
|
63
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
+
rspec-support (~> 3.6.0)
|
65
|
+
rspec-its (1.2.0)
|
66
|
+
rspec-core (>= 3.0.0)
|
67
|
+
rspec-expectations (>= 3.0.0)
|
68
|
+
rspec-mocks (3.6.0)
|
69
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
+
rspec-support (~> 3.6.0)
|
71
|
+
rspec-support (3.6.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.9)
|
84
|
+
|
85
|
+
PLATFORMS
|
86
|
+
ruby
|
87
|
+
|
88
|
+
DEPENDENCIES
|
89
|
+
activerecord (~> 4.1.14)
|
90
|
+
activerecord-jdbcsqlite3-adapter
|
91
|
+
appraisal (~> 2.1.0)
|
92
|
+
aruba
|
93
|
+
cucumber (~> 1.3.15)
|
94
|
+
factory_girl!
|
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.15.4
|
@@ -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", "~> 4.2.5.1"
|
9
|
+
|
10
|
+
gemspec :path => "../"
|
@@ -0,0 +1,104 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
factory_girl (4.8.1)
|
5
|
+
activesupport (>= 3.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (4.2.5.2)
|
11
|
+
activesupport (= 4.2.5.2)
|
12
|
+
builder (~> 3.1)
|
13
|
+
activerecord (4.2.5.2)
|
14
|
+
activemodel (= 4.2.5.2)
|
15
|
+
activesupport (= 4.2.5.2)
|
16
|
+
arel (~> 6.0)
|
17
|
+
activesupport (4.2.5.2)
|
18
|
+
i18n (~> 0.7)
|
19
|
+
json (~> 1.7, >= 1.7.7)
|
20
|
+
minitest (~> 5.1)
|
21
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
22
|
+
tzinfo (~> 1.1)
|
23
|
+
appraisal (2.1.0)
|
24
|
+
bundler
|
25
|
+
rake
|
26
|
+
thor (>= 0.14.0)
|
27
|
+
arel (6.0.4)
|
28
|
+
aruba (0.14.2)
|
29
|
+
childprocess (~> 0.5.6)
|
30
|
+
contracts (~> 0.9)
|
31
|
+
cucumber (>= 1.3.19)
|
32
|
+
ffi (~> 1.9.10)
|
33
|
+
rspec-expectations (>= 2.99)
|
34
|
+
thor (~> 0.19)
|
35
|
+
builder (3.2.3)
|
36
|
+
childprocess (0.5.9)
|
37
|
+
ffi (~> 1.0, >= 1.0.11)
|
38
|
+
contracts (0.16.0)
|
39
|
+
cucumber (1.3.20)
|
40
|
+
builder (>= 2.1.2)
|
41
|
+
diff-lcs (>= 1.1.3)
|
42
|
+
gherkin (~> 2.12)
|
43
|
+
multi_json (>= 1.7.5, < 2.0)
|
44
|
+
multi_test (>= 0.1.2)
|
45
|
+
diff-lcs (1.3)
|
46
|
+
docile (1.1.5)
|
47
|
+
ffi (1.9.18)
|
48
|
+
gherkin (2.12.2)
|
49
|
+
multi_json (~> 1.3)
|
50
|
+
i18n (0.8.6)
|
51
|
+
json (1.8.6)
|
52
|
+
minitest (5.10.3)
|
53
|
+
multi_json (1.12.2)
|
54
|
+
multi_test (0.1.2)
|
55
|
+
rake (12.1.0)
|
56
|
+
rspec (3.6.0)
|
57
|
+
rspec-core (~> 3.6.0)
|
58
|
+
rspec-expectations (~> 3.6.0)
|
59
|
+
rspec-mocks (~> 3.6.0)
|
60
|
+
rspec-core (3.6.0)
|
61
|
+
rspec-support (~> 3.6.0)
|
62
|
+
rspec-expectations (3.6.0)
|
63
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
+
rspec-support (~> 3.6.0)
|
65
|
+
rspec-its (1.2.0)
|
66
|
+
rspec-core (>= 3.0.0)
|
67
|
+
rspec-expectations (>= 3.0.0)
|
68
|
+
rspec-mocks (3.6.0)
|
69
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
+
rspec-support (~> 3.6.0)
|
71
|
+
rspec-support (3.6.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.9)
|
84
|
+
|
85
|
+
PLATFORMS
|
86
|
+
ruby
|
87
|
+
|
88
|
+
DEPENDENCIES
|
89
|
+
activerecord (~> 4.2.5.1)
|
90
|
+
activerecord-jdbcsqlite3-adapter
|
91
|
+
appraisal (~> 2.1.0)
|
92
|
+
aruba
|
93
|
+
cucumber (~> 1.3.15)
|
94
|
+
factory_girl!
|
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.15.4
|
@@ -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.0.0"
|
9
|
+
|
10
|
+
gemspec :path => "../"
|
@@ -0,0 +1,103 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
factory_girl (4.8.1)
|
5
|
+
activesupport (>= 3.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (5.0.6)
|
11
|
+
activesupport (= 5.0.6)
|
12
|
+
activerecord (5.0.6)
|
13
|
+
activemodel (= 5.0.6)
|
14
|
+
activesupport (= 5.0.6)
|
15
|
+
arel (~> 7.0)
|
16
|
+
activesupport (5.0.6)
|
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 (7.1.4)
|
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.8.6)
|
50
|
+
json (2.1.0)
|
51
|
+
minitest (5.10.3)
|
52
|
+
multi_json (1.12.2)
|
53
|
+
multi_test (0.1.2)
|
54
|
+
rake (12.1.0)
|
55
|
+
rspec (3.6.0)
|
56
|
+
rspec-core (~> 3.6.0)
|
57
|
+
rspec-expectations (~> 3.6.0)
|
58
|
+
rspec-mocks (~> 3.6.0)
|
59
|
+
rspec-core (3.6.0)
|
60
|
+
rspec-support (~> 3.6.0)
|
61
|
+
rspec-expectations (3.6.0)
|
62
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
63
|
+
rspec-support (~> 3.6.0)
|
64
|
+
rspec-its (1.2.0)
|
65
|
+
rspec-core (>= 3.0.0)
|
66
|
+
rspec-expectations (>= 3.0.0)
|
67
|
+
rspec-mocks (3.6.0)
|
68
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
+
rspec-support (~> 3.6.0)
|
70
|
+
rspec-support (3.6.0)
|
71
|
+
simplecov (0.15.1)
|
72
|
+
docile (~> 1.1.0)
|
73
|
+
json (>= 1.8, < 3)
|
74
|
+
simplecov-html (~> 0.10.0)
|
75
|
+
simplecov-html (0.10.2)
|
76
|
+
sqlite3 (1.3.13)
|
77
|
+
thor (0.20.0)
|
78
|
+
thread_safe (0.3.6)
|
79
|
+
timecop (0.9.1)
|
80
|
+
tzinfo (1.2.3)
|
81
|
+
thread_safe (~> 0.1)
|
82
|
+
yard (0.9.9)
|
83
|
+
|
84
|
+
PLATFORMS
|
85
|
+
ruby
|
86
|
+
|
87
|
+
DEPENDENCIES
|
88
|
+
activerecord (~> 5.0.0)
|
89
|
+
activerecord-jdbcsqlite3-adapter
|
90
|
+
appraisal (~> 2.1.0)
|
91
|
+
aruba
|
92
|
+
cucumber (~> 1.3.15)
|
93
|
+
factory_girl!
|
94
|
+
jdbc-sqlite3
|
95
|
+
rspec (~> 3.0)
|
96
|
+
rspec-its (~> 1.0)
|
97
|
+
simplecov
|
98
|
+
sqlite3 (~> 1.3.10)
|
99
|
+
timecop
|
100
|
+
yard
|
101
|
+
|
102
|
+
BUNDLED WITH
|
103
|
+
1.15.4
|
@@ -11,7 +11,10 @@ module FactoryGirl
|
|
11
11
|
block = @block
|
12
12
|
|
13
13
|
-> {
|
14
|
-
value = block.arity
|
14
|
+
value = case block.arity
|
15
|
+
when 1, -1 then instance_exec(self, &block)
|
16
|
+
else instance_exec(&block)
|
17
|
+
end
|
15
18
|
raise SequenceAbuseError if FactoryGirl::Sequence === value
|
16
19
|
value
|
17
20
|
}
|
@@ -13,7 +13,7 @@ module FactoryGirl
|
|
13
13
|
@evaluator.instance = build_class_instance
|
14
14
|
build_class_instance.tap do |instance|
|
15
15
|
attributes_to_set_on_instance.each do |attribute|
|
16
|
-
instance.
|
16
|
+
instance.public_send("#{attribute}=", get(attribute))
|
17
17
|
@attribute_names_assigned << attribute
|
18
18
|
end
|
19
19
|
end
|
@@ -89,9 +89,9 @@ module FactoryGirl
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def alias_names_to_ignore
|
92
|
-
@attribute_list.non_ignored.
|
93
|
-
override_names.map {|override| attribute.name if attribute.alias_for?(override) && attribute.name != override && !ignored_attribute_names.include?(override) }
|
94
|
-
end.
|
92
|
+
@attribute_list.non_ignored.flat_map do |attribute|
|
93
|
+
override_names.map { |override| attribute.name if attribute.alias_for?(override) && attribute.name != override && !ignored_attribute_names.include?(override) }
|
94
|
+
end.compact
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
@@ -10,7 +10,7 @@ module FactoryGirl
|
|
10
10
|
|
11
11
|
def run(instance, evaluator)
|
12
12
|
case block.arity
|
13
|
-
when 1 then syntax_runner.instance_exec(instance, &block)
|
13
|
+
when 1, -1 then syntax_runner.instance_exec(instance, &block)
|
14
14
|
when 2 then syntax_runner.instance_exec(instance, evaluator, &block)
|
15
15
|
else syntax_runner.instance_exec(&block)
|
16
16
|
end
|
@@ -3,6 +3,8 @@ module FactoryGirl
|
|
3
3
|
class Configuration
|
4
4
|
attr_reader :factories, :sequences, :traits, :strategies, :callback_names
|
5
5
|
|
6
|
+
attr_accessor :allow_class_lookup, :use_parent_strategy
|
7
|
+
|
6
8
|
def initialize
|
7
9
|
@factories = Decorator::DisallowsDuplicatesRegistry.new(Registry.new('Factory'))
|
8
10
|
@sequences = Decorator::DisallowsDuplicatesRegistry.new(Registry.new('Sequence'))
|
@@ -11,11 +13,14 @@ module FactoryGirl
|
|
11
13
|
@callback_names = Set.new
|
12
14
|
@definition = Definition.new
|
13
15
|
|
14
|
-
|
16
|
+
@allow_class_lookup = true
|
17
|
+
|
18
|
+
to_create { |instance| instance.save! }
|
15
19
|
initialize_with { new }
|
16
20
|
end
|
17
21
|
|
18
|
-
delegate :to_create, :skip_create, :constructor,
|
22
|
+
delegate :to_create, :skip_create, :constructor, :before, :after,
|
23
|
+
:callback, :callbacks, to: :@definition
|
19
24
|
|
20
25
|
def initialize_with(&block)
|
21
26
|
@definition.define_constructor(&block)
|
@@ -35,11 +35,11 @@ module FactoryGirl
|
|
35
35
|
private
|
36
36
|
|
37
37
|
def delete_declaration(declaration)
|
38
|
-
@declarations.delete_if {|decl| decl.name == declaration.name }
|
38
|
+
@declarations.delete_if { |decl| decl.name == declaration.name }
|
39
39
|
end
|
40
40
|
|
41
41
|
def to_attributes
|
42
|
-
@declarations.inject([]) {|result, declaration| result += declaration.to_attributes }
|
42
|
+
@declarations.inject([]) { |result, declaration| result += declaration.to_attributes }
|
43
43
|
end
|
44
44
|
|
45
45
|
def overridable?
|
@@ -18,7 +18,8 @@ module FactoryGirl
|
|
18
18
|
def symbolized_key(key)
|
19
19
|
if key.respond_to?(:to_sym)
|
20
20
|
key.to_sym
|
21
|
-
|
21
|
+
elsif FactoryGirl.allow_class_lookup
|
22
|
+
ActiveSupport::Deprecation.warn "Looking up factories by class is deprecated and will be removed in 5.0. Use symbols instead and set FactoryGirl.allow_class_lookup = false", caller
|
22
23
|
key.to_s.underscore.to_sym
|
23
24
|
end
|
24
25
|
end
|