ffactory_girl 4.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/.autotest +9 -0
  3. data/.gitignore +9 -0
  4. data/.rspec +2 -0
  5. data/.simplecov +4 -0
  6. data/.travis.yml +38 -0
  7. data/.yardopts +5 -0
  8. data/Appraisals +19 -0
  9. data/CONTRIBUTING.md +60 -0
  10. data/GETTING_STARTED.md +1391 -0
  11. data/Gemfile +8 -0
  12. data/Gemfile.lock +116 -0
  13. data/LICENSE +19 -0
  14. data/NAME.md +11 -0
  15. data/NEWS +290 -0
  16. data/README.md +98 -0
  17. data/Rakefile +36 -0
  18. data/cucumber.yml +1 -0
  19. data/factory_girl.gemspec +36 -0
  20. data/gemfiles/3.2.gemfile +10 -0
  21. data/gemfiles/3.2.gemfile.lock +105 -0
  22. data/gemfiles/4.0.gemfile +10 -0
  23. data/gemfiles/4.0.gemfile.lock +105 -0
  24. data/gemfiles/4.1.gemfile +10 -0
  25. data/gemfiles/4.1.gemfile.lock +104 -0
  26. data/gemfiles/4.2.gemfile +10 -0
  27. data/gemfiles/4.2.gemfile.lock +104 -0
  28. data/gemfiles/5.0.gemfile +10 -0
  29. data/gemfiles/5.0.gemfile.lock +103 -0
  30. data/lib/factory_girl/aliases.rb +18 -0
  31. data/lib/factory_girl/attribute/association.rb +27 -0
  32. data/lib/factory_girl/attribute/dynamic.rb +24 -0
  33. data/lib/factory_girl/attribute/sequence.rb +16 -0
  34. data/lib/factory_girl/attribute/static.rb +16 -0
  35. data/lib/factory_girl/attribute.rb +62 -0
  36. data/lib/factory_girl/attribute_assigner.rb +97 -0
  37. data/lib/factory_girl/attribute_list.rb +67 -0
  38. data/lib/factory_girl/callback.rb +40 -0
  39. data/lib/factory_girl/callbacks_observer.rb +21 -0
  40. data/lib/factory_girl/configuration.rb +37 -0
  41. data/lib/factory_girl/declaration/association.rb +28 -0
  42. data/lib/factory_girl/declaration/dynamic.rb +26 -0
  43. data/lib/factory_girl/declaration/implicit.rb +33 -0
  44. data/lib/factory_girl/declaration/static.rb +26 -0
  45. data/lib/factory_girl/declaration.rb +23 -0
  46. data/lib/factory_girl/declaration_list.rb +49 -0
  47. data/lib/factory_girl/decorator/attribute_hash.rb +16 -0
  48. data/lib/factory_girl/decorator/class_key_hash.rb +28 -0
  49. data/lib/factory_girl/decorator/disallows_duplicates_registry.rb +13 -0
  50. data/lib/factory_girl/decorator/invocation_tracker.rb +19 -0
  51. data/lib/factory_girl/decorator/new_constructor.rb +12 -0
  52. data/lib/factory_girl/decorator.rb +21 -0
  53. data/lib/factory_girl/definition.rb +136 -0
  54. data/lib/factory_girl/definition_hierarchy.rb +48 -0
  55. data/lib/factory_girl/definition_proxy.rb +174 -0
  56. data/lib/factory_girl/errors.rb +25 -0
  57. data/lib/factory_girl/evaluation.rb +27 -0
  58. data/lib/factory_girl/evaluator.rb +82 -0
  59. data/lib/factory_girl/evaluator_class_definer.rb +20 -0
  60. data/lib/factory_girl/factory.rb +163 -0
  61. data/lib/factory_girl/factory_runner.rb +33 -0
  62. data/lib/factory_girl/find_definitions.rb +25 -0
  63. data/lib/factory_girl/linter.rb +97 -0
  64. data/lib/factory_girl/null_factory.rb +18 -0
  65. data/lib/factory_girl/null_object.rb +24 -0
  66. data/lib/factory_girl/registry.rb +38 -0
  67. data/lib/factory_girl/reload.rb +8 -0
  68. data/lib/factory_girl/sequence.rb +62 -0
  69. data/lib/factory_girl/strategy/attributes_for.rb +13 -0
  70. data/lib/factory_girl/strategy/build.rb +15 -0
  71. data/lib/factory_girl/strategy/create.rb +18 -0
  72. data/lib/factory_girl/strategy/null.rb +11 -0
  73. data/lib/factory_girl/strategy/stub.rb +111 -0
  74. data/lib/factory_girl/strategy_calculator.rb +26 -0
  75. data/lib/factory_girl/strategy_syntax_method_registrar.rb +54 -0
  76. data/lib/factory_girl/syntax/default.rb +76 -0
  77. data/lib/factory_girl/syntax/methods.rb +111 -0
  78. data/lib/factory_girl/syntax.rb +7 -0
  79. data/lib/factory_girl/syntax_runner.rb +6 -0
  80. data/lib/factory_girl/trait.rb +30 -0
  81. data/lib/factory_girl/version.rb +3 -0
  82. data/lib/factory_girl.rb +156 -0
  83. metadata +271 -0
@@ -0,0 +1,105 @@
1
+ GIT
2
+ remote: https://github.com/rails/rails.git
3
+ revision: e17e25cd23e8abd45b1706463dd57c90fa6dcb7c
4
+ branch: 3-2-stable
5
+ specs:
6
+ activemodel (3.2.22.5)
7
+ activesupport (= 3.2.22.5)
8
+ builder (~> 3.0)
9
+ activerecord (3.2.22.5)
10
+ activemodel (= 3.2.22.5)
11
+ activesupport (= 3.2.22.5)
12
+ arel (~> 3.0.2)
13
+ tzinfo (~> 0.3.29)
14
+ activesupport (3.2.22.5)
15
+ i18n (~> 0.6, >= 0.6.4)
16
+ multi_json (~> 1.0)
17
+
18
+ PATH
19
+ remote: ../
20
+ specs:
21
+ factory_girl (4.8.1)
22
+ activesupport (>= 3.0.0)
23
+
24
+ GEM
25
+ remote: https://rubygems.org/
26
+ specs:
27
+ appraisal (2.1.0)
28
+ bundler
29
+ rake
30
+ thor (>= 0.14.0)
31
+ arel (3.0.3)
32
+ aruba (0.14.2)
33
+ childprocess (~> 0.5.6)
34
+ contracts (~> 0.9)
35
+ cucumber (>= 1.3.19)
36
+ ffi (~> 1.9.10)
37
+ rspec-expectations (>= 2.99)
38
+ thor (~> 0.19)
39
+ builder (3.2.3)
40
+ childprocess (0.5.9)
41
+ ffi (~> 1.0, >= 1.0.11)
42
+ contracts (0.16.0)
43
+ cucumber (1.3.20)
44
+ builder (>= 2.1.2)
45
+ diff-lcs (>= 1.1.3)
46
+ gherkin (~> 2.12)
47
+ multi_json (>= 1.7.5, < 2.0)
48
+ multi_test (>= 0.1.2)
49
+ diff-lcs (1.3)
50
+ docile (1.1.5)
51
+ ffi (1.9.18)
52
+ gherkin (2.12.2)
53
+ multi_json (~> 1.3)
54
+ i18n (0.8.6)
55
+ json (2.1.0)
56
+ multi_json (1.12.2)
57
+ multi_test (0.1.2)
58
+ rake (12.1.0)
59
+ rspec (3.6.0)
60
+ rspec-core (~> 3.6.0)
61
+ rspec-expectations (~> 3.6.0)
62
+ rspec-mocks (~> 3.6.0)
63
+ rspec-core (3.6.0)
64
+ rspec-support (~> 3.6.0)
65
+ rspec-expectations (3.6.0)
66
+ diff-lcs (>= 1.2.0, < 2.0)
67
+ rspec-support (~> 3.6.0)
68
+ rspec-its (1.2.0)
69
+ rspec-core (>= 3.0.0)
70
+ rspec-expectations (>= 3.0.0)
71
+ rspec-mocks (3.6.0)
72
+ diff-lcs (>= 1.2.0, < 2.0)
73
+ rspec-support (~> 3.6.0)
74
+ rspec-support (3.6.0)
75
+ simplecov (0.15.1)
76
+ docile (~> 1.1.0)
77
+ json (>= 1.8, < 3)
78
+ simplecov-html (~> 0.10.0)
79
+ simplecov-html (0.10.2)
80
+ sqlite3 (1.3.13)
81
+ thor (0.20.0)
82
+ timecop (0.9.1)
83
+ tzinfo (0.3.53)
84
+ yard (0.9.9)
85
+
86
+ PLATFORMS
87
+ ruby
88
+
89
+ DEPENDENCIES
90
+ activerecord!
91
+ activerecord-jdbcsqlite3-adapter
92
+ appraisal (~> 2.1.0)
93
+ aruba
94
+ cucumber (~> 1.3.15)
95
+ factory_girl!
96
+ jdbc-sqlite3
97
+ rspec (~> 3.0)
98
+ rspec-its (~> 1.0)
99
+ simplecov
100
+ sqlite3 (~> 1.3.10)
101
+ timecop
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.0.13"
9
+
10
+ gemspec :path => "../"
@@ -0,0 +1,105 @@
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.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)
26
+ bundler
27
+ rake
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)
37
+ builder (3.1.4)
38
+ childprocess (0.5.9)
39
+ ffi (~> 1.0, >= 1.0.11)
40
+ contracts (0.16.0)
41
+ cucumber (1.3.20)
42
+ builder (>= 2.1.2)
43
+ diff-lcs (>= 1.1.3)
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)
85
+
86
+ PLATFORMS
87
+ ruby
88
+
89
+ DEPENDENCIES
90
+ activerecord (~> 4.0.13)
91
+ activerecord-jdbcsqlite3-adapter
92
+ appraisal (~> 2.1.0)
93
+ aruba
94
+ cucumber (~> 1.3.15)
95
+ factory_girl!
96
+ jdbc-sqlite3
97
+ rspec (~> 3.0)
98
+ rspec-its (~> 1.0)
99
+ simplecov
100
+ sqlite3 (~> 1.3.10)
101
+ timecop
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
@@ -0,0 +1,18 @@
1
+ module FactoryGirl
2
+ class << self
3
+ attr_accessor :aliases
4
+ end
5
+
6
+ self.aliases = [
7
+ [/(.+)_id/, '\1'],
8
+ [/(.*)/, '\1_id']
9
+ ]
10
+
11
+ def self.aliases_for(attribute)
12
+ aliases.map do |(pattern, replace)|
13
+ if pattern.match(attribute.to_s)
14
+ attribute.to_s.sub(pattern, replace).to_sym
15
+ end
16
+ end.compact << attribute
17
+ end
18
+ end
@@ -0,0 +1,27 @@
1
+ module FactoryGirl
2
+ class Attribute
3
+ # @api private
4
+ class Association < Attribute
5
+ attr_reader :factory
6
+
7
+ def initialize(name, factory, overrides)
8
+ super(name, false)
9
+ @factory = factory
10
+ @overrides = overrides
11
+ end
12
+
13
+ def to_proc
14
+ factory = @factory
15
+ overrides = @overrides
16
+ traits_and_overrides = [factory, overrides].flatten
17
+ factory_name = traits_and_overrides.shift
18
+
19
+ -> { association(factory_name, *traits_and_overrides) }
20
+ end
21
+
22
+ def association?
23
+ true
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,24 @@
1
+ module FactoryGirl
2
+ class Attribute
3
+ # @api private
4
+ class Dynamic < Attribute
5
+ def initialize(name, ignored, block)
6
+ super(name, ignored)
7
+ @block = block
8
+ end
9
+
10
+ def to_proc
11
+ block = @block
12
+
13
+ -> {
14
+ value = case block.arity
15
+ when 1, -1 then instance_exec(self, &block)
16
+ else instance_exec(&block)
17
+ end
18
+ raise SequenceAbuseError if FactoryGirl::Sequence === value
19
+ value
20
+ }
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,16 @@
1
+ module FactoryGirl
2
+ class Attribute
3
+ # @api private
4
+ class Sequence < Attribute
5
+ def initialize(name, sequence, ignored)
6
+ super(name, ignored)
7
+ @sequence = sequence
8
+ end
9
+
10
+ def to_proc
11
+ sequence = @sequence
12
+ -> { FactoryGirl.generate(sequence) }
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module FactoryGirl
2
+ class Attribute
3
+ # @api private
4
+ class Static < Attribute
5
+ def initialize(name, value, ignored)
6
+ super(name, ignored)
7
+ @value = value
8
+ end
9
+
10
+ def to_proc
11
+ value = @value
12
+ -> { value }
13
+ end
14
+ end
15
+ end
16
+ end