eac_rails_gem_support 0.1.0 → 0.1.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: 2c97abd1e7599cf2ae736f2c3e88a21b935238e8af9cf9feeb2aa41e1748f833
4
- data.tar.gz: 1cfc033902376938bb8cc84c760d3e60e311023828f5281b8c9536ea31ce3dbd
3
+ metadata.gz: d3eceb1c1e7a910b9301a3fc7adcd793db7f75b705655f6faae463ee13440162
4
+ data.tar.gz: e344a0569f787ea7a1e6fda11c78e827b1bd14eaf9319a9fa9cbf80a2a21d520
5
5
  SHA512:
6
- metadata.gz: 005c1b1a151e0a5bd1307babddbc7b4166f1977f9e93cbbccb62b58c0e319d9b3ec6ccfdd68dde22fb29242b74b50981ad3e208e371b7ba9a3f73e7510fa887e
7
- data.tar.gz: 4ba53aeffb36f35721acb4067ffe20b58793959e71557fc9eace4dc916aa782b6512cb16a497ba3baa9b6dc3596715b9bd503fd928234650d773c4e31dc1c62d
6
+ metadata.gz: 37d2da075e11632aa9433f91ed0da8d48fc58773c8335b4f89c37839d9410e726c50a62d88ac22ffe4287505962c35dcb08b383d0d6fe30ef437f58a8bc41356
7
+ data.tar.gz: 3695b465581a8edee371b6bb5747e8533dcb0bb52097c55450c1c3f3b9ac391bc92631f9a388f3b956e5a36d34c2b8e32a7c3bfcff2fa6b5fa93f3ec55d75d7e
@@ -4,33 +4,31 @@ require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module EacRailsGemSupport
6
6
  module Rspec
7
- class Setup
7
+ module Setup
8
+ extend ::ActiveSupport::Concern
8
9
  require_sub __FILE__, include_modules: true
9
- common_constructor :setup_obj
10
10
 
11
- def perform
12
- setup_rails_env
13
- return unless setup_rails_app
11
+ def self.extended(obj)
12
+ obj.setup_rails_env
13
+ return unless obj.setup_rails_app
14
14
 
15
- setup_fixtures
16
- setup_capybara
17
- setup_factory_bot
15
+ obj.setup_fixtures
16
+ obj.setup_capybara
17
+ obj.setup_factory_bot
18
18
  end
19
19
 
20
- private
21
-
22
20
  # @return [Pathname]
23
21
  def rails_app_path
24
22
  [
25
- setup_obj.app_root_path,
26
- setup_obj.app_root_path.join('spec', 'support', 'rails_app')
23
+ app_root_path,
24
+ app_root_path.join('spec', 'support', 'rails_app')
27
25
  ].find { |app_path| app_path.join('config', 'environment.rb').file? }
28
26
  end
29
27
 
30
28
  def fixtures_path
31
29
  [
32
- setup_obj.app_root_path.join('spec', 'fixtures'),
33
- setup_obj.app_root_path.join('test', 'fixtures')
30
+ app_root_path.join('spec', 'fixtures'),
31
+ app_root_path.join('test', 'fixtures')
34
32
  ].find(&:directory?)
35
33
  end
36
34
 
@@ -47,9 +45,9 @@ module EacRailsGemSupport
47
45
  end
48
46
 
49
47
  def setup_fixtures
50
- setup_obj.rspec_config.use_transactional_fixtures = true
48
+ rspec_config.use_transactional_fixtures = true
51
49
  fixtures_path.if_present do |v|
52
- setup_obj.rspec_config.fixture_path = v
50
+ rspec_config.fixture_path = v
53
51
  end
54
52
  end
55
53
 
@@ -4,11 +4,11 @@ require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module EacRailsGemSupport
6
6
  module Rspec
7
- class Setup
7
+ module Setup
8
8
  module Capybara
9
9
  def setup_capybara
10
10
  require 'capybara/rspec'
11
- setup_obj.rspec_config.include ::Capybara::DSL, file_path: 'spec/requests'
11
+ rspec_config.include ::Capybara::DSL, file_path: 'spec/requests'
12
12
  end
13
13
  end
14
14
  end
@@ -4,11 +4,11 @@ require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module EacRailsGemSupport
6
6
  module Rspec
7
- class Setup
7
+ module Setup
8
8
  module FactoryBot
9
9
  def setup_factory_bot
10
10
  require 'factory_bot_rails'
11
- setup_obj.rspec_config.include ::FactoryBot::Syntax::Methods
11
+ rspec_config.include ::FactoryBot::Syntax::Methods
12
12
  Spring.after_fork { ::FactoryBot.reload } if defined?(Spring)
13
13
  end
14
14
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsGemSupport
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_rails_gem_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-14 00:00:00.000000000 Z
11
+ date: 2021-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.3'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 0.3.3
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,20 +41,23 @@ dependencies:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
43
  version: '0.3'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.3.3
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: eac_ruby_utils
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
51
  - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: '0.71'
53
+ version: '0.74'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: '0.71'
60
+ version: '0.74'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: factory_bot_rails
57
63
  requirement: !ruby/object:Gem::Requirement