solidus_dev_support 2.4.1 → 2.5.1
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 +4 -4
- data/CHANGELOG.md +35 -1
- data/lib/solidus_dev_support/templates/extension/README.md +9 -2
- data/lib/solidus_dev_support/templates/extension/extension.gemspec.tt +1 -1
- data/lib/solidus_dev_support/testing_support/factories.rb +48 -12
- data/lib/solidus_dev_support/version.rb +1 -1
- data/solidus_dev_support.gemspec +4 -4
- metadata +23 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de0e1de74a5245a5b53d6b3a472e9c7135277231a68530530309f7ac40799eab
|
4
|
+
data.tar.gz: 50967859e827b59b3e3bc91036e224d6e85a13ab3fae5cbb1d27021e90b27523
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f81406fe09a753bdf323ba7823e72ef581a9cce0ceb67cd884a6703a565c461f604cb92c8449f59d998b9d06e046135a8d5d3d04c44a1a5987b97abee347865
|
7
|
+
data.tar.gz: 51c1c774c0252bbce8af10aa3b8369b9dc47f8452c87eb0385fe11a6c849295f19ba6b4e051a7c089d3a9e5baf763d6767fb5355cdb74012cb5892c4b9b4327b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,39 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v2.5.0](https://github.com/solidusio/solidus_dev_support/tree/v2.5.0) (2021-04-20)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.4.3...v2.5.0)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Allow Solidus 3 [\#176](https://github.com/solidusio/solidus_dev_support/pull/176) ([kennyadsl](https://github.com/kennyadsl))
|
10
|
+
- Relax Ruby version requirement [\#174](https://github.com/solidusio/solidus_dev_support/pull/174) ([gauravtiwari](https://github.com/gauravtiwari))
|
11
|
+
|
12
|
+
## [v2.4.3](https://github.com/solidusio/solidus_dev_support/tree/v2.4.3) (2021-02-23)
|
13
|
+
|
14
|
+
[Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.4.2...v2.4.3)
|
15
|
+
|
16
|
+
**Implemented enhancements:**
|
17
|
+
|
18
|
+
- Add instruction on how to use the new factories in apps [\#172](https://github.com/solidusio/solidus_dev_support/pull/172) ([kennyadsl](https://github.com/kennyadsl))
|
19
|
+
|
20
|
+
**Fixed bugs:**
|
21
|
+
|
22
|
+
- Explode directories into individual files [\#171](https://github.com/solidusio/solidus_dev_support/pull/171) ([kennyadsl](https://github.com/kennyadsl))
|
23
|
+
- Fix factories loading, part 2 [\#170](https://github.com/solidusio/solidus_dev_support/pull/170) ([kennyadsl](https://github.com/kennyadsl))
|
24
|
+
|
25
|
+
## [v2.4.2](https://github.com/solidusio/solidus_dev_support/tree/v2.4.2) (2021-02-19)
|
26
|
+
|
27
|
+
[Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.4.1...v2.4.2)
|
28
|
+
|
29
|
+
## [v2.4.1](https://github.com/solidusio/solidus_dev_support/tree/v2.4.1) (2021-02-19)
|
30
|
+
|
31
|
+
[Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.4.0...v2.4.1)
|
32
|
+
|
33
|
+
**Fixed bugs:**
|
34
|
+
|
35
|
+
- Fix loading factories in extensions after the last changes in Solidus [\#169](https://github.com/solidusio/solidus_dev_support/pull/169) ([kennyadsl](https://github.com/kennyadsl))
|
36
|
+
|
3
37
|
## [v2.4.0](https://github.com/solidusio/solidus_dev_support/tree/v2.4.0) (2021-02-05)
|
4
38
|
|
5
39
|
[Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.3.0...v2.4.0)
|
@@ -57,7 +91,7 @@
|
|
57
91
|
**Implemented enhancements:**
|
58
92
|
|
59
93
|
- Add standard github\_changelog\_generator configuration [\#151](https://github.com/solidusio/solidus_dev_support/pull/151) ([aldesantis](https://github.com/aldesantis))
|
60
|
-
- Move generated factories to `
|
94
|
+
- Move generated factories to `testing_support/` [\#150](https://github.com/solidusio/solidus_dev_support/pull/150) ([aldesantis](https://github.com/aldesantis))
|
61
95
|
- Add extension configuration boilerplate [\#149](https://github.com/solidusio/solidus_dev_support/pull/149) ([aldesantis](https://github.com/aldesantis))
|
62
96
|
|
63
97
|
**Fixed bugs:**
|
@@ -42,10 +42,17 @@ bundle exec rubocop
|
|
42
42
|
```
|
43
43
|
|
44
44
|
When testing your application's integration with this extension you may use its factories.
|
45
|
-
Simply add this require statement to your spec_helper
|
45
|
+
Simply add this require statement to your `spec/spec_helper.rb`:
|
46
46
|
|
47
47
|
```ruby
|
48
|
-
require '<%= file_name %>/factories'
|
48
|
+
require '<%= file_name %>/testing_support/factories'
|
49
|
+
```
|
50
|
+
|
51
|
+
Or, if you are using `FactoryBot.definition_file_paths`, you can load Solidus core
|
52
|
+
factories along with this extension's factories using this statement:
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
SolidusDevSupport::TestingSupport::Factories.load_for(<%= class_name %>::Engine)
|
49
56
|
```
|
50
57
|
|
51
58
|
### Running the sandbox
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
spec.add_dependency 'solidus_core', ['>= 2.0.0', '<
|
32
|
+
spec.add_dependency 'solidus_core', ['>= 2.0.0', '< 4']
|
33
33
|
spec.add_dependency 'solidus_support', '~> 0.5'
|
34
34
|
|
35
35
|
spec.add_development_dependency 'solidus_dev_support', '<%= SolidusDevSupport.gem_version.approximate_recommendation %>'
|
@@ -1,10 +1,28 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'factory_bot'
|
4
|
+
|
5
|
+
Spree::Deprecation.silence do
|
6
|
+
require 'spree/testing_support/factories'
|
7
|
+
puts <<~MSG
|
8
|
+
We are transitioning to a new way of loading factories for extensions.
|
9
|
+
Be sure this extension does not load factories using require but uses
|
10
|
+
the load_for() method in its spec_helper.rb, eg:
|
11
|
+
|
12
|
+
SolidusDevSupport::TestingSupport::Factories.load_for(ExtensionName1::Engine, ExtensionName2::Engine)
|
13
|
+
|
14
|
+
This will load Solidus Core factories right before the ones defined in
|
15
|
+
lib/extension_name/testing_support/factories/*_factory.rb or
|
16
|
+
lib/extension_name/testing_support/factories.rb
|
17
|
+
|
18
|
+
This message will be removed when all extensions are updated.
|
19
|
+
MSG
|
20
|
+
end
|
21
|
+
|
3
22
|
begin
|
4
23
|
require 'spree/testing_support/factory_bot'
|
5
24
|
rescue LoadError
|
6
|
-
|
7
|
-
require 'spree/testing_support/factories'
|
25
|
+
# Do nothing, we are testing the extension against an old version of Solidus
|
8
26
|
end
|
9
27
|
|
10
28
|
module SolidusDevSupport
|
@@ -12,21 +30,39 @@ module SolidusDevSupport
|
|
12
30
|
module Factories
|
13
31
|
def self.load_for(*engines)
|
14
32
|
paths = engines.flat_map do |engine|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
33
|
+
# Check if the extension has a lib/*/factories.rb. If it does, we emit a
|
34
|
+
# deprecation warning and just use it.
|
35
|
+
obsolete_factories_file = engine.root.glob('lib/*/factories.rb').first # 'lib/*/factories/*_factory.rb'
|
36
|
+
if obsolete_factories_file.present?
|
19
37
|
ActiveSupport::Deprecation.warn <<-WARN.squish, caller(4)
|
20
38
|
SolidusDevSupport::TestingSupport::Factories.load_for() is automatically loading
|
21
|
-
all factories present
|
22
|
-
|
39
|
+
all factories present in #{obsolete_factories_file.dirname.to_s.gsub(engine.root.to_s, '')}/testing_support/factories/.
|
40
|
+
Please move the content of #{obsolete_factories_file.to_s.gsub(engine.root.to_s, '')} to that directory.
|
23
41
|
WARN
|
24
42
|
|
25
|
-
|
43
|
+
[obsolete_factories_file]
|
26
44
|
else
|
27
|
-
|
28
|
-
|
29
|
-
|
45
|
+
# If there are both a lib/*/testing_support/factories.rb and a lib/*/testing_support/factories/,
|
46
|
+
# we assume that the factories.rb file is only used to load all factories prensent in the directory.
|
47
|
+
# That file can be removed from the extension, in fact, we ignore it and emit a message asking to
|
48
|
+
# remove it.
|
49
|
+
factories_file_or_folder = engine.root.glob('lib/*/testing_support/factories{,.rb}')
|
50
|
+
if factories_file_or_folder.size == 2
|
51
|
+
folder, file = factories_file_or_folder.partition(&:directory?).map(&:first).map { |path| path.to_s.gsub(engine.root.to_s, '') }
|
52
|
+
ActiveSupport::Deprecation.warn <<-WARN.squish, caller(4)
|
53
|
+
SolidusDevSupport::TestingSupport::Factories.load_for() is automatically loading
|
54
|
+
all factories present into #{folder}. You should now safely remove #{file} if it
|
55
|
+
is only used to load ./factories content.
|
56
|
+
WARN
|
57
|
+
|
58
|
+
engine.root.glob('lib/*/testing_support/factories/**/*_factory.rb')
|
59
|
+
elsif factories_file_or_folder.first.directory?
|
60
|
+
engine.root.glob('lib/*/testing_support/factories/**/*_factory.rb')
|
61
|
+
else
|
62
|
+
factories_file_or_folder
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end.map { |path| path.sub(/.rb\z/, '').to_s }
|
30
66
|
|
31
67
|
if using_factory_bot_definition_file_paths?
|
32
68
|
FactoryBot.definition_file_paths = [
|
data/solidus_dev_support.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.metadata['source_code_uri'] = 'https://github.com/solidusio/solidus_dev_support'
|
17
17
|
spec.metadata['changelog_uri'] = 'https://github.com/solidusio/solidus_dev_support/blob/master/CHANGELOG.md'
|
18
18
|
|
19
|
-
spec.required_ruby_version =
|
19
|
+
spec.required_ruby_version = '>= 2.5.0'
|
20
20
|
|
21
21
|
# Specify which files should be added to the gem when it is released.
|
22
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -37,14 +37,14 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_dependency 'ffaker', '~> 2.13'
|
38
38
|
spec.add_dependency 'gem-release', '~> 2.1'
|
39
39
|
spec.add_dependency 'github_changelog_generator', '~> 1.15'
|
40
|
-
spec.add_dependency 'puma', '
|
40
|
+
spec.add_dependency 'puma', '>= 4.3', '< 6.0'
|
41
41
|
spec.add_dependency 'rspec_junit_formatter'
|
42
|
-
spec.add_dependency 'rspec-rails', '
|
42
|
+
spec.add_dependency 'rspec-rails', '>= 4.0.0.beta3', '< 6.0'
|
43
43
|
spec.add_dependency 'rubocop', '~> 1.0'
|
44
44
|
spec.add_dependency 'rubocop-performance', '~> 1.5'
|
45
45
|
spec.add_dependency 'rubocop-rails', '~> 2.3'
|
46
46
|
spec.add_dependency 'rubocop-rspec', '~> 2.0'
|
47
|
-
spec.add_dependency 'solidus_core', ['>= 2.0', '<
|
47
|
+
spec.add_dependency 'solidus_core', ['>= 2.0', '< 4']
|
48
48
|
spec.add_dependency 'webdrivers', '~> 4.4'
|
49
49
|
|
50
50
|
spec.add_development_dependency 'bundler'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_dev_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Desantis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -140,16 +140,22 @@ dependencies:
|
|
140
140
|
name: puma
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '4.3'
|
146
|
+
- - "<"
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '6.0'
|
146
149
|
type: :runtime
|
147
150
|
prerelease: false
|
148
151
|
version_requirements: !ruby/object:Gem::Requirement
|
149
152
|
requirements:
|
150
|
-
- - "
|
153
|
+
- - ">="
|
151
154
|
- !ruby/object:Gem::Version
|
152
155
|
version: '4.3'
|
156
|
+
- - "<"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '6.0'
|
153
159
|
- !ruby/object:Gem::Dependency
|
154
160
|
name: rspec_junit_formatter
|
155
161
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,16 +174,22 @@ dependencies:
|
|
168
174
|
name: rspec-rails
|
169
175
|
requirement: !ruby/object:Gem::Requirement
|
170
176
|
requirements:
|
171
|
-
- - "
|
177
|
+
- - ">="
|
172
178
|
- !ruby/object:Gem::Version
|
173
179
|
version: 4.0.0.beta3
|
180
|
+
- - "<"
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '6.0'
|
174
183
|
type: :runtime
|
175
184
|
prerelease: false
|
176
185
|
version_requirements: !ruby/object:Gem::Requirement
|
177
186
|
requirements:
|
178
|
-
- - "
|
187
|
+
- - ">="
|
179
188
|
- !ruby/object:Gem::Version
|
180
189
|
version: 4.0.0.beta3
|
190
|
+
- - "<"
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '6.0'
|
181
193
|
- !ruby/object:Gem::Dependency
|
182
194
|
name: rubocop
|
183
195
|
requirement: !ruby/object:Gem::Requirement
|
@@ -243,7 +255,7 @@ dependencies:
|
|
243
255
|
version: '2.0'
|
244
256
|
- - "<"
|
245
257
|
- !ruby/object:Gem::Version
|
246
|
-
version: '
|
258
|
+
version: '4'
|
247
259
|
type: :runtime
|
248
260
|
prerelease: false
|
249
261
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -253,7 +265,7 @@ dependencies:
|
|
253
265
|
version: '2.0'
|
254
266
|
- - "<"
|
255
267
|
- !ruby/object:Gem::Version
|
256
|
-
version: '
|
268
|
+
version: '4'
|
257
269
|
- !ruby/object:Gem::Dependency
|
258
270
|
name: webdrivers
|
259
271
|
requirement: !ruby/object:Gem::Requirement
|
@@ -390,16 +402,16 @@ require_paths:
|
|
390
402
|
- lib
|
391
403
|
required_ruby_version: !ruby/object:Gem::Requirement
|
392
404
|
requirements:
|
393
|
-
- - "
|
405
|
+
- - ">="
|
394
406
|
- !ruby/object:Gem::Version
|
395
|
-
version:
|
407
|
+
version: 2.5.0
|
396
408
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
397
409
|
requirements:
|
398
410
|
- - ">="
|
399
411
|
- !ruby/object:Gem::Version
|
400
412
|
version: '0'
|
401
413
|
requirements: []
|
402
|
-
rubygems_version: 3.
|
414
|
+
rubygems_version: 3.2.20
|
403
415
|
signing_key:
|
404
416
|
specification_version: 4
|
405
417
|
summary: Development tools for Solidus extensions.
|