factory_bot_instrumentation 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/factory_bot_instrumentation.gemspec +1 -0
- data/lib/factory_bot/instrumentation/engine.rb +10 -5
- data/lib/factory_bot/instrumentation/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df9495f96882f162c18ca1c8467d09c34d8dc40981ed1a7ba541a7d5200867a9
|
4
|
+
data.tar.gz: 2ae4e05a4dbd3e729d56ffbfeafb2c14aeef6b6a8e825a6b94023bb6fa379823
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c598dcbc2cf1cfc4f7e7c6d9a1e0389f7c9583e9208ae008db35cf320ba740232a9038fb6c00b92b06d95ca5483fee5663b88e70b39c6e7371624494d337f21f
|
7
|
+
data.tar.gz: dd88ab7d48335f79c874005ea50ee76a6878af89cc3ebbb5333ade70059f084654c20ae83a2200d1d6c2730ced8e58859a4358c8934703f19fa2dfe5f29e766b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
### 1.0.2
|
2
|
+
|
3
|
+
* When used in combination with the `factory_bot_rails` gem (>= 6.0) we do not
|
4
|
+
force a `FactoryBot.reload` at Rails engine initialization as it breaks with
|
5
|
+
an `FactoryBot::DuplicateDefinitionError` (#14)
|
6
|
+
|
1
7
|
### 1.0.1
|
2
8
|
|
3
9
|
* Added a retry logic to the FactoryBot reloading on the POST/create endpoint
|
@@ -40,6 +40,7 @@ Gem::Specification.new do |spec|
|
|
40
40
|
spec.add_development_dependency 'appraisal', '~> 2.4'
|
41
41
|
spec.add_development_dependency 'bundler', '~> 2.3'
|
42
42
|
spec.add_development_dependency 'countless', '~> 1.1'
|
43
|
+
spec.add_development_dependency 'factory_bot_rails', '~> 6.2'
|
43
44
|
spec.add_development_dependency 'guard-rspec', '~> 4.7'
|
44
45
|
spec.add_development_dependency 'railties', '>= 5.2'
|
45
46
|
spec.add_development_dependency 'rspec-rails', '~> 5.1'
|
@@ -7,11 +7,16 @@ module FactoryBot
|
|
7
7
|
isolate_namespace FactoryBot::Instrumentation
|
8
8
|
|
9
9
|
# Fill in some dynamic settings (application related)
|
10
|
-
initializer 'factory_bot_instrumentation.config' do
|
11
|
-
# Ensure the FactoryBot gem loads its factories to ensure they are
|
12
|
-
#
|
13
|
-
#
|
14
|
-
FactoryBot
|
10
|
+
initializer 'factory_bot_instrumentation.config' do |app|
|
11
|
+
# Ensure the FactoryBot gem loads its factories to ensure they are also
|
12
|
+
# available in the rails console and other places in the app and not
|
13
|
+
# only via instrumentation frontend. We skip this step as in
|
14
|
+
# combination with the +factory_bot_rails+ gem (>=6.0) the FactoryBot
|
15
|
+
# initializing occurs after the Rails application initializing, which
|
16
|
+
# leads to +FactoryBot::DuplicateDefinitionError+s.
|
17
|
+
initializer_names = app.initializers.map(&:name).map(&:to_s)
|
18
|
+
FactoryBot.reload \
|
19
|
+
if initializer_names.grep(/^factory_bot\./).count.zero?
|
15
20
|
|
16
21
|
FactoryBot::Instrumentation.configure do |conf|
|
17
22
|
# Set the application name dynamically
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory_bot_instrumentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hermann Mayer
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: factory_bot_rails
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '6.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '6.2'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: guard-rspec
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|