eac_rails_gem_support 0.4.1 → 0.5.0

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: c2d27c9e93e9f57c4fbbda5273500380a91a06a3023131841d081faebd62f51c
4
- data.tar.gz: 62e24d1ea6d28f56920adcd043c3ec21ed0598389e3301f9be6b981a00c3a813
3
+ metadata.gz: f7f28694f2816be105b4a9ad99a509894c0ef93cc44799f46a288b10dadff69f
4
+ data.tar.gz: 2ae43a634dcc87ca9cbb9fb22fe4c7e0c00cfaa88f6202aa9acd51144e5ebd5b
5
5
  SHA512:
6
- metadata.gz: e1e0d339d245a463eaa995179b230333e4c5097abbe1f9e50764649155c45f9e744ee4edfda1ff1d3a5d07c0b74c21dbed6f786f821a7ca6d68904548b35af16
7
- data.tar.gz: 6a7c4fcd80333110416a5e1767aac16fc9b037ca2270d6f8d7f49be94d8890927cf1239ccf5c31cafc84d1a74b2f290e8d4d69f9937f5731c203e2863f1721bd
6
+ metadata.gz: 4ca045ef2cb5f4101ee66ca0d48fde679812a0f06647c1b53bb5ab1e2b4a5b5ac30a55f07004e20c863f70e87ea08f985c680c363a381cb4105564748419ce4c
7
+ data.tar.gz: 3c931401695a187fabfaa430eaf21f0e1cd0135afd5d35f04a1845bfaabec7e2d7faadd2525962f8a40ad5b1c1f4b74a34aa19b054a2eefaaa1f2019259b09bd
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacRailsGemSupport
4
+ module Rspec
5
+ module MinitestSupport
6
+ def assert_difference(code, message = nil, compare_method = :not_to, &block)
7
+ before_value = assert_difference_call(code)
8
+ block.call
9
+ after_value = assert_difference_call(code)
10
+ expect(after_value).send(compare_method, eq(before_value), message)
11
+ end
12
+
13
+ def assert_no_difference(code, message = nil, &block)
14
+ assert_difference(code, message, :to, &block)
15
+ end
16
+
17
+ def assert_equal(expected_value, actual_value, message = nil)
18
+ expect(actual_value).to eq(expected_value), message
19
+ end
20
+
21
+ def assert_not(expected_value, message = nil)
22
+ expect(expected_value).to be_falsy, message
23
+ end
24
+
25
+ def assert_not_equal(expected_value, actual_value, message = nil)
26
+ expect(actual_value).not_to eq(expected_value), message
27
+ end
28
+
29
+ private
30
+
31
+ def assert_difference_call(code)
32
+ if code.is_a?(::Proc)
33
+ code.call
34
+ elsif code.is_a?(::String)
35
+ eval(code) # rubocop:disable Security/Eval
36
+ else
37
+ raise "Unmapped type for \"#{code}\""
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_rails_gem_support/rspec/minitest_support'
3
4
  require 'eac_ruby_utils/core_ext'
4
5
 
5
6
  module EacRailsGemSupport
@@ -9,13 +10,18 @@ module EacRailsGemSupport
9
10
  require_sub __FILE__, include_modules: true
10
11
 
11
12
  def self.extended(obj)
13
+ obj.setup_minitest_support
12
14
  obj.singleton_class.include(::EacRubyUtils::SimpleCache)
13
15
  obj.setup_rails_env
14
16
  return unless obj.setup_rails_app
15
17
 
16
- obj.setup_fixtures
17
- obj.setup_capybara
18
- obj.setup_factory_bot
18
+ %w[fixtures capybara factory_bot].each do |item|
19
+ obj.send("setup_#{item}")
20
+ end
21
+ end
22
+
23
+ def setup_minitest_support
24
+ rspec_config.include ::EacRailsGemSupport::Rspec::MinitestSupport
19
25
  end
20
26
  end
21
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsGemSupport
4
- VERSION = '0.4.1'
4
+ VERSION = '0.5.0'
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.4.1
4
+ version: 0.5.0
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: 2022-07-05 00:00:00.000000000 Z
11
+ date: 2022-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm-eac_ruby_base1
@@ -16,33 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.8'
19
+ version: '0.20'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.8'
26
+ version: '0.20'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: capybara
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.37'
31
34
  - - ">="
32
35
  - !ruby/object:Gem::Version
33
- version: '0'
36
+ version: 3.37.1
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '3.37'
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
- version: '0'
46
+ version: 3.37.1
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: eac_ruby_gem_support
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
51
  - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '0.5'
54
+ - - ">="
46
55
  - !ruby/object:Gem::Version
47
56
  version: 0.5.1
48
57
  type: :runtime
@@ -50,6 +59,9 @@ dependencies:
50
59
  version_requirements: !ruby/object:Gem::Requirement
51
60
  requirements:
52
61
  - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '0.5'
64
+ - - ">="
53
65
  - !ruby/object:Gem::Version
54
66
  version: 0.5.1
55
67
  - !ruby/object:Gem::Dependency
@@ -58,20 +70,20 @@ dependencies:
58
70
  requirements:
59
71
  - - "~>"
60
72
  - !ruby/object:Gem::Version
61
- version: '0.95'
73
+ version: '0.102'
62
74
  - - ">="
63
75
  - !ruby/object:Gem::Version
64
- version: 0.95.1
76
+ version: 0.102.1
65
77
  type: :runtime
66
78
  prerelease: false
67
79
  version_requirements: !ruby/object:Gem::Requirement
68
80
  requirements:
69
81
  - - "~>"
70
82
  - !ruby/object:Gem::Version
71
- version: '0.95'
83
+ version: '0.102'
72
84
  - - ">="
73
85
  - !ruby/object:Gem::Version
74
- version: 0.95.1
86
+ version: 0.102.1
75
87
  - !ruby/object:Gem::Dependency
76
88
  name: eac_templates
77
89
  requirement: !ruby/object:Gem::Requirement
@@ -96,16 +108,16 @@ dependencies:
96
108
  name: factory_bot_rails
97
109
  requirement: !ruby/object:Gem::Requirement
98
110
  requirements:
99
- - - ">="
111
+ - - "~>"
100
112
  - !ruby/object:Gem::Version
101
- version: '0'
113
+ version: '6.2'
102
114
  type: :runtime
103
115
  prerelease: false
104
116
  version_requirements: !ruby/object:Gem::Requirement
105
117
  requirements:
106
- - - ">="
118
+ - - "~>"
107
119
  - !ruby/object:Gem::Version
108
- version: '0'
120
+ version: '6.2'
109
121
  - !ruby/object:Gem::Dependency
110
122
  name: rails
111
123
  requirement: !ruby/object:Gem::Requirement
@@ -113,6 +125,9 @@ dependencies:
113
125
  - - "~>"
114
126
  - !ruby/object:Gem::Version
115
127
  version: 5.2.8
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: 5.2.8.1
116
131
  type: :runtime
117
132
  prerelease: false
118
133
  version_requirements: !ruby/object:Gem::Requirement
@@ -120,34 +135,49 @@ dependencies:
120
135
  - - "~>"
121
136
  - !ruby/object:Gem::Version
122
137
  version: 5.2.8
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: 5.2.8.1
123
141
  - !ruby/object:Gem::Dependency
124
142
  name: rspec-rails
125
143
  requirement: !ruby/object:Gem::Requirement
126
144
  requirements:
145
+ - - "~>"
146
+ - !ruby/object:Gem::Version
147
+ version: '5.1'
127
148
  - - ">="
128
149
  - !ruby/object:Gem::Version
129
- version: '0'
150
+ version: 5.1.2
130
151
  type: :runtime
131
152
  prerelease: false
132
153
  version_requirements: !ruby/object:Gem::Requirement
133
154
  requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: '5.1'
134
158
  - - ">="
135
159
  - !ruby/object:Gem::Version
136
- version: '0'
160
+ version: 5.1.2
137
161
  - !ruby/object:Gem::Dependency
138
162
  name: sqlite3
139
163
  requirement: !ruby/object:Gem::Requirement
140
164
  requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: '1.4'
141
168
  - - ">="
142
169
  - !ruby/object:Gem::Version
143
- version: '0'
170
+ version: 1.4.4
144
171
  type: :runtime
145
172
  prerelease: false
146
173
  version_requirements: !ruby/object:Gem::Requirement
147
174
  requirements:
175
+ - - "~>"
176
+ - !ruby/object:Gem::Version
177
+ version: '1.4'
148
178
  - - ">="
149
179
  - !ruby/object:Gem::Version
150
- version: '0'
180
+ version: 1.4.4
151
181
  description:
152
182
  email:
153
183
  executables: []
@@ -159,6 +189,7 @@ files:
159
189
  - lib/eac_rails_gem_support/patches/object/template.rb
160
190
  - lib/eac_rails_gem_support/rspec.rb
161
191
  - lib/eac_rails_gem_support/rspec/appendable_rails_app.rb
192
+ - lib/eac_rails_gem_support/rspec/minitest_support.rb
162
193
  - lib/eac_rails_gem_support/rspec/setup.rb
163
194
  - lib/eac_rails_gem_support/rspec/setup/capybara.rb
164
195
  - lib/eac_rails_gem_support/rspec/setup/factory_bot.rb