solidus_dev_support 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74ab2edd76151f60e52665d3c8afbc84d0e375c6ab477110861a9e726e170e25
4
- data.tar.gz: a2620208442a87b76478a0280da69fc762b5bb71b297af15ec8bd29bceb377a0
3
+ metadata.gz: d8b89b3a9856d2e920d23a4aa6b111f5d0183ac78c6a4148b1eb41627277bc5a
4
+ data.tar.gz: b5ba6eda194e217eb30e965a278f69cf3a0ecd09d3c1b589e66cfbe4bdb49ad5
5
5
  SHA512:
6
- metadata.gz: 0abc59073c06ce56cc8e673e157d474f8a55e2423a733bfb960f4fff9084ad06415bfcb133e867c761e97c0508c98ed9c4ad2e9686a0e3b0fa36be4428302f32
7
- data.tar.gz: 6c069a4c5e6bca0401114cebf205bd869be8890862c55f53b8fc0c003ad3906637b438a540739ba822ff4ca4ae07838e995c8274a9a5d4527fbc09e427873792
6
+ metadata.gz: 778ebb59f1f980c9a978fb353c3ba68b4e89bdafe1b0f2d4509108fcac286f08e9e7c1923db706ff809f4bea47df6359dfa82c012b8061dcfabc9f0afd5701c1
7
+ data.tar.gz: f1de5819cdd6f252490fa1ee458765b1a47dd1a82f46e92b5b7b027fe80682b6955144aaa7491f4bf56cae910133431a2fa7dc842365d9b69170b251d2a8fe3c
data/CHANGELOG.md CHANGED
@@ -1,8 +1,25 @@
1
1
  # Changelog
2
2
 
3
- ## [2.3.0](https://github.com/solidusio/solidus_dev_support/tree/2.3.0) (2021-01-14)
3
+ ## [v2.4.0](https://github.com/solidusio/solidus_dev_support/tree/v2.4.0) (2021-02-05)
4
4
 
5
- [Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.2.0...2.3.0)
5
+ [Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.3.0...v2.4.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Improve engine's requires to remove double inclusions [\#165](https://github.com/solidusio/solidus_dev_support/pull/165) ([kennyadsl](https://github.com/kennyadsl))
10
+ - Remove double require of core factories from rails\_helper [\#164](https://github.com/solidusio/solidus_dev_support/pull/164) ([kennyadsl](https://github.com/kennyadsl))
11
+
12
+ **Fixed bugs:**
13
+
14
+ - Fix typo in configuration.rb.tt [\#166](https://github.com/solidusio/solidus_dev_support/pull/166) ([brchristian](https://github.com/brchristian))
15
+
16
+ **Merged pull requests:**
17
+
18
+ - Rename spree:install to solidus:install in the sandbox template [\#167](https://github.com/solidusio/solidus_dev_support/pull/167) ([blocknotes](https://github.com/blocknotes))
19
+
20
+ ## [v2.3.0](https://github.com/solidusio/solidus_dev_support/tree/v2.3.0) (2021-01-14)
21
+
22
+ [Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.2.0...v2.3.0)
6
23
 
7
24
  **Implemented enhancements:**
8
25
 
@@ -1,20 +1,39 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factories'
4
- require 'factory_bot'
3
+ begin
4
+ require 'spree/testing_support/factory_bot'
5
+ rescue LoadError
6
+ require 'factory_bot'
7
+ require 'spree/testing_support/factories'
8
+ end
5
9
 
6
10
  module SolidusDevSupport
7
11
  module TestingSupport
8
12
  module Factories
9
13
  def self.load_for(*engines)
10
14
  paths = engines.flat_map do |engine|
11
- engine.root.glob('lib/**/factories.rb')
15
+ factories_file_or_folder = engine.root.glob('lib/*/testing_support/factories{,.rb}')
16
+
17
+ if factories_file_or_folder.size == 2 && using_factory_bot_definition_file_paths?
18
+ folder, file = factories_file_or_folder.partition(&:directory?).map(&:first).map { |path| path.to_s.gsub(engine.root.to_s, '') }
19
+ ActiveSupport::Deprecation.warn <<-WARN.squish, caller(4)
20
+ SolidusDevSupport::TestingSupport::Factories.load_for() is automatically loading
21
+ all factories present into #{folder}. You should now safely remove #{file} if it
22
+ is only used to load ./factories content.
23
+ WARN
24
+
25
+ engine.root.glob('lib/*/testing_support/factories/**/*_factory.rb')
26
+ else
27
+ factories_file_or_folder
28
+ end.map { |path| path.sub(/.rb\z/, '').to_s }
12
29
  end
13
30
 
14
- if Spree::TestingSupport.respond_to? :load_all_factories
15
- FactoryBot.definition_file_paths.concat(
16
- paths.map { |path| path.sub(/.rb\z/, '').to_s }
17
- )
31
+ if using_factory_bot_definition_file_paths?
32
+ FactoryBot.definition_file_paths = [
33
+ Spree::TestingSupport::FactoryBot.definition_file_paths,
34
+ paths,
35
+ ].flatten
36
+
18
37
  FactoryBot.reload
19
38
  else
20
39
  FactoryBot.find_definitions
@@ -22,6 +41,11 @@ module SolidusDevSupport
22
41
  paths.each { |path| require path }
23
42
  end
24
43
  end
44
+
45
+ def self.using_factory_bot_definition_file_paths?
46
+ defined?(Spree::TestingSupport::FactoryBot) &&
47
+ Spree::TestingSupport::FactoryBot.respond_to?(:definition_file_paths)
48
+ end
25
49
  end
26
50
  end
27
51
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusDevSupport
4
- VERSION = "2.4.0"
4
+ VERSION = "2.4.1"
5
5
 
6
6
  def self.gem_version
7
7
  Gem::Version.new(VERSION)
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.0
4
+ version: 2.4.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-02-05 00:00:00.000000000 Z
11
+ date: 2021-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara