factory_bot 4.8.2 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +5 -5
  2. data/.yardopts +1 -0
  3. data/GETTING_STARTED.md +226 -129
  4. data/LICENSE +1 -1
  5. data/NAME.md +12 -5
  6. data/NEWS.md +351 -0
  7. data/README.md +35 -27
  8. data/lib/factory_bot/aliases.rb +1 -1
  9. data/lib/factory_bot/attribute/dynamic.rb +1 -0
  10. data/lib/factory_bot/attribute.rb +4 -39
  11. data/lib/factory_bot/attribute_assigner.rb +21 -6
  12. data/lib/factory_bot/attribute_list.rb +2 -1
  13. data/lib/factory_bot/callback.rb +3 -2
  14. data/lib/factory_bot/configuration.rb +16 -20
  15. data/lib/factory_bot/declaration/association.rb +14 -1
  16. data/lib/factory_bot/declaration/dynamic.rb +3 -1
  17. data/lib/factory_bot/declaration/implicit.rb +7 -2
  18. data/lib/factory_bot/declaration.rb +4 -4
  19. data/lib/factory_bot/declaration_list.rb +1 -1
  20. data/lib/factory_bot/decorator/attribute_hash.rb +1 -1
  21. data/lib/factory_bot/decorator/invocation_tracker.rb +1 -1
  22. data/lib/factory_bot/decorator.rb +5 -1
  23. data/lib/factory_bot/definition.rb +10 -7
  24. data/lib/factory_bot/definition_hierarchy.rb +1 -11
  25. data/lib/factory_bot/definition_proxy.rb +65 -41
  26. data/lib/factory_bot/errors.rb +7 -4
  27. data/lib/factory_bot/evaluation.rb +1 -1
  28. data/lib/factory_bot/evaluator.rb +5 -5
  29. data/lib/factory_bot/factory.rb +8 -8
  30. data/lib/factory_bot/factory_runner.rb +3 -3
  31. data/lib/factory_bot/find_definitions.rb +1 -1
  32. data/lib/factory_bot/internal.rb +104 -0
  33. data/lib/factory_bot/linter.rb +36 -19
  34. data/lib/factory_bot/null_factory.rb +4 -1
  35. data/lib/factory_bot/null_object.rb +2 -2
  36. data/lib/factory_bot/registry.rb +15 -6
  37. data/lib/factory_bot/reload.rb +3 -3
  38. data/lib/factory_bot/sequence.rb +9 -1
  39. data/lib/factory_bot/strategy/null.rb +2 -4
  40. data/lib/factory_bot/strategy/stub.rb +32 -36
  41. data/lib/factory_bot/strategy_calculator.rb +1 -1
  42. data/lib/factory_bot/strategy_syntax_method_registrar.rb +13 -2
  43. data/lib/factory_bot/syntax/default.rb +12 -24
  44. data/lib/factory_bot/syntax/methods.rb +32 -9
  45. data/lib/factory_bot/syntax.rb +2 -2
  46. data/lib/factory_bot/trait.rb +6 -3
  47. data/lib/factory_bot/version.rb +1 -1
  48. data/lib/factory_bot.rb +103 -134
  49. metadata +79 -64
  50. data/.autotest +0 -9
  51. data/.gitignore +0 -10
  52. data/.rspec +0 -2
  53. data/.simplecov +0 -4
  54. data/.travis.yml +0 -38
  55. data/Appraisals +0 -19
  56. data/Gemfile +0 -8
  57. data/Gemfile.lock +0 -103
  58. data/NEWS +0 -293
  59. data/Rakefile +0 -36
  60. data/cucumber.yml +0 -1
  61. data/factory_bot.gemspec +0 -36
  62. data/factory_girl.gemspec +0 -40
  63. data/gemfiles/3.2.gemfile +0 -10
  64. data/gemfiles/3.2.gemfile.lock +0 -105
  65. data/gemfiles/4.0.gemfile +0 -10
  66. data/gemfiles/4.0.gemfile.lock +0 -105
  67. data/gemfiles/4.1.gemfile +0 -10
  68. data/gemfiles/4.1.gemfile.lock +0 -104
  69. data/gemfiles/4.2.gemfile +0 -10
  70. data/gemfiles/4.2.gemfile.lock +0 -104
  71. data/gemfiles/5.0.gemfile +0 -10
  72. data/gemfiles/5.0.gemfile.lock +0 -103
  73. data/lib/factory_bot/attribute/static.rb +0 -16
  74. data/lib/factory_bot/declaration/static.rb +0 -26
  75. data/lib/factory_bot/decorator/class_key_hash.rb +0 -28
  76. data/lib/factory_girl.rb +0 -5
@@ -4,12 +4,14 @@ module FactoryBot
4
4
  attr_reader :name, :definition
5
5
 
6
6
  def initialize(name, &block)
7
- @name = name
7
+ @name = name.to_s
8
8
  @block = block
9
9
  @definition = Definition.new(@name)
10
-
11
10
  proxy = FactoryBot::DefinitionProxy.new(@definition)
12
- proxy.instance_eval(&@block) if block_given?
11
+
12
+ if block_given?
13
+ proxy.instance_eval(&@block)
14
+ end
13
15
  end
14
16
 
15
17
  delegate :add_callback, :declare_attribute, :to_create, :define_trait, :constructor,
@@ -25,6 +27,7 @@ module FactoryBot
25
27
  end
26
28
 
27
29
  protected
30
+
28
31
  attr_reader :block
29
32
  end
30
33
  end
@@ -1,3 +1,3 @@
1
1
  module FactoryBot
2
- VERSION = "4.8.2".freeze
2
+ VERSION = "5.2.0".freeze
3
3
  end
data/lib/factory_bot.rb CHANGED
@@ -1,59 +1,57 @@
1
- require 'set'
2
- require 'active_support/core_ext/module/delegation'
3
- require 'active_support/deprecation'
4
- require 'active_support/notifications'
5
-
6
- require 'factory_bot/definition_hierarchy'
7
- require 'factory_bot/configuration'
8
- require 'factory_bot/errors'
9
- require 'factory_bot/factory_runner'
10
- require 'factory_bot/strategy_syntax_method_registrar'
11
- require 'factory_bot/strategy_calculator'
12
- require 'factory_bot/strategy/build'
13
- require 'factory_bot/strategy/create'
14
- require 'factory_bot/strategy/attributes_for'
15
- require 'factory_bot/strategy/stub'
16
- require 'factory_bot/strategy/null'
17
- require 'factory_bot/registry'
18
- require 'factory_bot/null_factory'
19
- require 'factory_bot/null_object'
20
- require 'factory_bot/evaluation'
21
- require 'factory_bot/factory'
22
- require 'factory_bot/attribute_assigner'
23
- require 'factory_bot/evaluator'
24
- require 'factory_bot/evaluator_class_definer'
25
- require 'factory_bot/attribute'
26
- require 'factory_bot/callback'
27
- require 'factory_bot/callbacks_observer'
28
- require 'factory_bot/declaration_list'
29
- require 'factory_bot/declaration'
30
- require 'factory_bot/sequence'
31
- require 'factory_bot/attribute_list'
32
- require 'factory_bot/trait'
33
- require 'factory_bot/aliases'
34
- require 'factory_bot/definition'
35
- require 'factory_bot/definition_proxy'
36
- require 'factory_bot/syntax'
37
- require 'factory_bot/syntax_runner'
38
- require 'factory_bot/find_definitions'
39
- require 'factory_bot/reload'
40
- require 'factory_bot/decorator'
41
- require 'factory_bot/decorator/attribute_hash'
42
- require 'factory_bot/decorator/class_key_hash'
43
- require 'factory_bot/decorator/disallows_duplicates_registry'
44
- require 'factory_bot/decorator/invocation_tracker'
45
- require 'factory_bot/decorator/new_constructor'
46
- require 'factory_bot/linter'
47
- require 'factory_bot/version'
1
+ require "set"
2
+ require "active_support/core_ext/module/delegation"
3
+ require "active_support/core_ext/module/attribute_accessors"
4
+ require "active_support/deprecation"
5
+ require "active_support/notifications"
6
+
7
+ require "factory_bot/internal"
8
+ require "factory_bot/definition_hierarchy"
9
+ require "factory_bot/configuration"
10
+ require "factory_bot/errors"
11
+ require "factory_bot/factory_runner"
12
+ require "factory_bot/strategy_syntax_method_registrar"
13
+ require "factory_bot/strategy_calculator"
14
+ require "factory_bot/strategy/build"
15
+ require "factory_bot/strategy/create"
16
+ require "factory_bot/strategy/attributes_for"
17
+ require "factory_bot/strategy/stub"
18
+ require "factory_bot/strategy/null"
19
+ require "factory_bot/registry"
20
+ require "factory_bot/null_factory"
21
+ require "factory_bot/null_object"
22
+ require "factory_bot/evaluation"
23
+ require "factory_bot/factory"
24
+ require "factory_bot/attribute_assigner"
25
+ require "factory_bot/evaluator"
26
+ require "factory_bot/evaluator_class_definer"
27
+ require "factory_bot/attribute"
28
+ require "factory_bot/callback"
29
+ require "factory_bot/callbacks_observer"
30
+ require "factory_bot/declaration_list"
31
+ require "factory_bot/declaration"
32
+ require "factory_bot/sequence"
33
+ require "factory_bot/attribute_list"
34
+ require "factory_bot/trait"
35
+ require "factory_bot/aliases"
36
+ require "factory_bot/definition"
37
+ require "factory_bot/definition_proxy"
38
+ require "factory_bot/syntax"
39
+ require "factory_bot/syntax_runner"
40
+ require "factory_bot/find_definitions"
41
+ require "factory_bot/reload"
42
+ require "factory_bot/decorator"
43
+ require "factory_bot/decorator/attribute_hash"
44
+ require "factory_bot/decorator/disallows_duplicates_registry"
45
+ require "factory_bot/decorator/invocation_tracker"
46
+ require "factory_bot/decorator/new_constructor"
47
+ require "factory_bot/linter"
48
+ require "factory_bot/version"
48
49
 
49
50
  module FactoryBot
50
- def self.configuration
51
- @configuration ||= Configuration.new
52
- end
51
+ Deprecation = ActiveSupport::Deprecation.new("6.0", "factory_bot")
53
52
 
54
- def self.reset_configuration
55
- @configuration = nil
56
- end
53
+ mattr_accessor :use_parent_strategy, instance_accessor: false
54
+ self.use_parent_strategy = true
57
55
 
58
56
  # Look for errors in factories and (optionally) their traits.
59
57
  # Parameters:
@@ -61,96 +59,67 @@ module FactoryBot
61
59
  # options:
62
60
  # traits: true - to lint traits as well as factories
63
61
  # strategy: :create - to specify the strategy for linting
62
+ # verbose: true - to include full backtraces for each linting error
64
63
  def self.lint(*args)
65
64
  options = args.extract_options!
66
65
  factories_to_lint = args[0] || FactoryBot.factories
67
- linting_strategy = options[:traits] ? :factory_and_traits : :factory
68
- factory_strategy = options[:strategy] || :create
69
- Linter.new(factories_to_lint, linting_strategy, factory_strategy).lint!
66
+ Linter.new(factories_to_lint, **options).lint!
70
67
  end
71
68
 
72
69
  class << self
73
- delegate :factories,
74
- :sequences,
75
- :traits,
70
+ delegate :callback_names,
76
71
  :callbacks,
72
+ :configuration,
73
+ :constructor,
74
+ :factories,
75
+ :factory_by_name,
76
+ :initialize_with,
77
+ :register_callback,
78
+ :register_default_callbacks,
79
+ :register_default_strategies,
80
+ :register_factory,
81
+ :register_sequence,
82
+ :register_strategy,
83
+ :register_trait,
84
+ :reset_configuration,
85
+ :rewind_sequences,
86
+ :sequence_by_name,
87
+ :sequences,
88
+ :skip_create,
77
89
  :strategies,
78
- :callback_names,
90
+ :strategy_by_name,
79
91
  :to_create,
80
- :skip_create,
81
- :initialize_with,
82
- :constructor,
83
- :duplicate_attribute_assignment_from_initialize_with,
84
- :duplicate_attribute_assignment_from_initialize_with=,
85
- :allow_class_lookup,
86
- :allow_class_lookup=,
87
- :use_parent_strategy,
88
- :use_parent_strategy=,
89
- to: :configuration
90
- end
91
-
92
- def self.register_factory(factory)
93
- factory.names.each do |name|
94
- factories.register(name, factory)
95
- end
96
- factory
97
- end
98
-
99
- def self.factory_by_name(name)
100
- factories.find(name)
101
- end
102
-
103
- def self.register_sequence(sequence)
104
- sequence.names.each do |name|
105
- sequences.register(name, sequence)
106
- end
107
- sequence
108
- end
109
-
110
- def self.sequence_by_name(name)
111
- sequences.find(name)
112
- end
113
-
114
- def self.register_trait(trait)
115
- trait.names.each do |name|
116
- traits.register(name, trait)
117
- end
118
- trait
119
- end
120
-
121
- def self.trait_by_name(name)
122
- traits.find(name)
123
- end
124
-
125
- def self.register_strategy(strategy_name, strategy_class)
126
- strategies.register(strategy_name, strategy_class)
127
- StrategySyntaxMethodRegistrar.new(strategy_name).define_strategy_methods
128
- end
129
-
130
- def self.strategy_by_name(name)
131
- strategies.find(name)
132
- end
133
-
134
- def self.register_default_strategies
135
- register_strategy(:build, FactoryBot::Strategy::Build)
136
- register_strategy(:create, FactoryBot::Strategy::Create)
137
- register_strategy(:attributes_for, FactoryBot::Strategy::AttributesFor)
138
- register_strategy(:build_stubbed, FactoryBot::Strategy::Stub)
139
- register_strategy(:null, FactoryBot::Strategy::Null)
140
- end
141
-
142
- def self.register_default_callbacks
143
- register_callback(:after_build)
144
- register_callback(:after_create)
145
- register_callback(:after_stub)
146
- register_callback(:before_create)
147
- end
148
-
149
- def self.register_callback(name)
150
- name = name.to_sym
151
- callback_names << name
92
+ :trait_by_name,
93
+ :traits,
94
+ to: Internal
95
+
96
+ attr_accessor :allow_class_lookup
97
+
98
+ deprecate :allow_class_lookup,
99
+ :allow_class_lookup=,
100
+ :callback_names,
101
+ :callbacks,
102
+ :configuration,
103
+ :constructor,
104
+ :factory_by_name,
105
+ :initialize_with,
106
+ :register_callback,
107
+ :register_default_callbacks,
108
+ :register_default_strategies,
109
+ :register_factory,
110
+ :register_sequence,
111
+ :register_trait,
112
+ :reset_configuration,
113
+ :sequence_by_name,
114
+ :sequences,
115
+ :skip_create,
116
+ :strategies,
117
+ :to_create,
118
+ :trait_by_name,
119
+ :traits,
120
+ deprecator: Deprecation
152
121
  end
153
122
  end
154
123
 
155
- FactoryBot.register_default_strategies
156
- FactoryBot.register_default_callbacks
124
+ FactoryBot::Internal.register_default_strategies
125
+ FactoryBot::Internal.register_default_callbacks
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.8.2
4
+ version: 5.2.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: 2017-10-20 00:00:00.000000000 Z
12
+ date: 2020-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -17,58 +17,72 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 3.0.0
20
+ version: 4.2.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 3.0.0
27
+ version: 4.2.0
28
28
  - !ruby/object:Gem::Dependency
29
- name: rspec
29
+ name: activerecord
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '3.0'
34
+ version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '3.0'
41
+ version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: rspec-its
43
+ name: appraisal
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '1.0'
48
+ version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '1.0'
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: aruba
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: cucumber
58
72
  requirement: !ruby/object:Gem::Requirement
59
73
  requirements:
60
- - - "~>"
74
+ - - ">="
61
75
  - !ruby/object:Gem::Version
62
- version: 1.3.15
76
+ version: '0'
63
77
  type: :development
64
78
  prerelease: false
65
79
  version_requirements: !ruby/object:Gem::Requirement
66
80
  requirements:
67
- - - "~>"
81
+ - - ">="
68
82
  - !ruby/object:Gem::Version
69
- version: 1.3.15
83
+ version: '0'
70
84
  - !ruby/object:Gem::Dependency
71
- name: timecop
85
+ name: rake
72
86
  requirement: !ruby/object:Gem::Requirement
73
87
  requirements:
74
88
  - - ">="
@@ -82,7 +96,7 @@ dependencies:
82
96
  - !ruby/object:Gem::Version
83
97
  version: '0'
84
98
  - !ruby/object:Gem::Dependency
85
- name: simplecov
99
+ name: rspec
86
100
  requirement: !ruby/object:Gem::Requirement
87
101
  requirements:
88
102
  - - ">="
@@ -96,7 +110,7 @@ dependencies:
96
110
  - !ruby/object:Gem::Version
97
111
  version: '0'
98
112
  - !ruby/object:Gem::Dependency
99
- name: aruba
113
+ name: rspec-its
100
114
  requirement: !ruby/object:Gem::Requirement
101
115
  requirements:
102
116
  - - ">="
@@ -110,33 +124,61 @@ dependencies:
110
124
  - !ruby/object:Gem::Version
111
125
  version: '0'
112
126
  - !ruby/object:Gem::Dependency
113
- name: appraisal
127
+ name: rubocop
114
128
  requirement: !ruby/object:Gem::Requirement
115
129
  requirements:
116
- - - "~>"
130
+ - - ">="
117
131
  - !ruby/object:Gem::Version
118
- version: 2.1.0
132
+ version: '0'
119
133
  type: :development
120
134
  prerelease: false
121
135
  version_requirements: !ruby/object:Gem::Requirement
122
136
  requirements:
123
- - - "~>"
137
+ - - ">="
124
138
  - !ruby/object:Gem::Version
125
- version: 2.1.0
139
+ version: '0'
126
140
  - !ruby/object:Gem::Dependency
127
- name: activerecord
141
+ name: rubocop-performance
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ - !ruby/object:Gem::Dependency
155
+ name: rubocop-rails
128
156
  requirement: !ruby/object:Gem::Requirement
129
157
  requirements:
130
158
  - - ">="
131
159
  - !ruby/object:Gem::Version
132
- version: 3.0.0
160
+ version: '0'
133
161
  type: :development
134
162
  prerelease: false
135
163
  version_requirements: !ruby/object:Gem::Requirement
136
164
  requirements:
137
165
  - - ">="
138
166
  - !ruby/object:Gem::Version
139
- version: 3.0.0
167
+ version: '0'
168
+ - !ruby/object:Gem::Dependency
169
+ name: simplecov
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ type: :development
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
140
182
  - !ruby/object:Gem::Dependency
141
183
  name: yard
142
184
  requirement: !ruby/object:Gem::Requirement
@@ -151,10 +193,8 @@ dependencies:
151
193
  - - ">="
152
194
  - !ruby/object:Gem::Version
153
195
  version: '0'
154
- description: |-
155
- factory_bot provides a framework and DSL for defining and
156
- using factories - less error-prone, more explicit, and
157
- all-around easier to work with than fixtures.
196
+ description: factory_bot provides a framework and DSL for defining and using factories
197
+ - less error-prone, more explicit, and all-around easier to work with than fixtures.
158
198
  email:
159
199
  - jclayton@thoughtbot.com
160
200
  - jferris@thoughtbot.com
@@ -162,42 +202,19 @@ executables: []
162
202
  extensions: []
163
203
  extra_rdoc_files: []
164
204
  files:
165
- - ".autotest"
166
- - ".gitignore"
167
- - ".rspec"
168
- - ".simplecov"
169
- - ".travis.yml"
170
205
  - ".yardopts"
171
- - Appraisals
172
206
  - CONTRIBUTING.md
173
207
  - GETTING_STARTED.md
174
- - Gemfile
175
- - Gemfile.lock
176
208
  - LICENSE
177
209
  - NAME.md
178
- - NEWS
210
+ - NEWS.md
179
211
  - README.md
180
- - Rakefile
181
- - cucumber.yml
182
- - factory_bot.gemspec
183
- - factory_girl.gemspec
184
- - gemfiles/3.2.gemfile
185
- - gemfiles/3.2.gemfile.lock
186
- - gemfiles/4.0.gemfile
187
- - gemfiles/4.0.gemfile.lock
188
- - gemfiles/4.1.gemfile
189
- - gemfiles/4.1.gemfile.lock
190
- - gemfiles/4.2.gemfile
191
- - gemfiles/4.2.gemfile.lock
192
- - gemfiles/5.0.gemfile
193
- - gemfiles/5.0.gemfile.lock
194
212
  - lib/factory_bot.rb
195
213
  - lib/factory_bot/aliases.rb
196
214
  - lib/factory_bot/attribute.rb
197
215
  - lib/factory_bot/attribute/association.rb
198
216
  - lib/factory_bot/attribute/dynamic.rb
199
217
  - lib/factory_bot/attribute/sequence.rb
200
- - lib/factory_bot/attribute/static.rb
201
218
  - lib/factory_bot/attribute_assigner.rb
202
219
  - lib/factory_bot/attribute_list.rb
203
220
  - lib/factory_bot/callback.rb
@@ -207,11 +224,9 @@ files:
207
224
  - lib/factory_bot/declaration/association.rb
208
225
  - lib/factory_bot/declaration/dynamic.rb
209
226
  - lib/factory_bot/declaration/implicit.rb
210
- - lib/factory_bot/declaration/static.rb
211
227
  - lib/factory_bot/declaration_list.rb
212
228
  - lib/factory_bot/decorator.rb
213
229
  - lib/factory_bot/decorator/attribute_hash.rb
214
- - lib/factory_bot/decorator/class_key_hash.rb
215
230
  - lib/factory_bot/decorator/disallows_duplicates_registry.rb
216
231
  - lib/factory_bot/decorator/invocation_tracker.rb
217
232
  - lib/factory_bot/decorator/new_constructor.rb
@@ -225,6 +240,7 @@ files:
225
240
  - lib/factory_bot/factory.rb
226
241
  - lib/factory_bot/factory_runner.rb
227
242
  - lib/factory_bot/find_definitions.rb
243
+ - lib/factory_bot/internal.rb
228
244
  - lib/factory_bot/linter.rb
229
245
  - lib/factory_bot/null_factory.rb
230
246
  - lib/factory_bot/null_object.rb
@@ -244,11 +260,11 @@ files:
244
260
  - lib/factory_bot/syntax_runner.rb
245
261
  - lib/factory_bot/trait.rb
246
262
  - lib/factory_bot/version.rb
247
- - lib/factory_girl.rb
248
263
  homepage: https://github.com/thoughtbot/factory_bot
249
264
  licenses:
250
265
  - MIT
251
- metadata: {}
266
+ metadata:
267
+ changelog_uri: https://github.com/thoughtbot/factory_bot/blob/master/NEWS.md
252
268
  post_install_message:
253
269
  rdoc_options: []
254
270
  require_paths:
@@ -257,15 +273,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
257
273
  requirements:
258
274
  - - ">="
259
275
  - !ruby/object:Gem::Version
260
- version: 1.9.2
276
+ version: 2.3.0
261
277
  required_rubygems_version: !ruby/object:Gem::Requirement
262
278
  requirements:
263
279
  - - ">="
264
280
  - !ruby/object:Gem::Version
265
281
  version: '0'
266
282
  requirements: []
267
- rubyforge_project:
268
- rubygems_version: 2.6.11
283
+ rubygems_version: 3.0.3
269
284
  signing_key:
270
285
  specification_version: 4
271
286
  summary: factory_bot provides a framework and DSL for defining and using model instance
data/.autotest DELETED
@@ -1,9 +0,0 @@
1
- Autotest.add_hook :initialize do |at|
2
- at.clear_mappings
3
-
4
- at.add_mapping(%r{^test/.*_test\.rb$}) {|f, _| [f] }
5
- at.add_mapping(%r{^lib/factory_girl/(.*)\.rb$}) {|_, m| ["test/#{m[1]}_test.rb",
6
- "test/integration_test.rb"] }
7
- at.add_mapping(%r{^test/(test_helper|models)\.rb$}) { at.files_matching %r{^test/.*_test\.rb$} }
8
- at.add_mapping(%r{^lib/.*\.rb$}) { at.files_matching %r{^test/.*_test\.rb$} }
9
- end
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- *.swp
2
- test.db
3
- factory_girl-*.gem
4
- factory_bot-*.gem
5
- doc
6
- .yardoc
7
- coverage
8
- .bundle
9
- tmp
10
- bin
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format progress
2
- --color
data/.simplecov DELETED
@@ -1,4 +0,0 @@
1
- SimpleCov.start do
2
- add_filter "/spec/"
3
- add_filter "/tmp/"
4
- end
data/.travis.yml DELETED
@@ -1,38 +0,0 @@
1
- rvm:
2
- - 1.9.3
3
- - 2.0.0
4
- - 2.1.9
5
- - 2.2.5
6
- - 2.3.1
7
- - ruby-head
8
- - rbx-2
9
- before_install:
10
- - gem update --system
11
- - gem update bundler
12
- - gem cleanup bundler
13
- install: "bundle install --jobs 8"
14
- script: "bundle exec rake"
15
- gemfile:
16
- - gemfiles/3.2.gemfile
17
- - gemfiles/4.0.gemfile
18
- - gemfiles/4.1.gemfile
19
- - gemfiles/4.2.gemfile
20
- - gemfiles/5.0.gemfile
21
- matrix:
22
- fast_finish: true
23
- exclude:
24
- - rvm: 1.9.3
25
- gemfile: gemfiles/5.0.gemfile
26
- - rvm: 2.0.0
27
- gemfile: gemfiles/5.0.gemfile
28
- - rvm: 2.1.9
29
- gemfile: gemfiles/5.0.gemfile
30
- allow_failures:
31
- - rvm: ruby-head
32
- - rvm: rbx-2
33
- branches:
34
- only:
35
- - master
36
-
37
- sudo: false
38
- cache: bundler