truemail-rspec 0.1.2 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,8 +12,8 @@ module Truemail
12
12
  end
13
13
 
14
14
  def create_configuration(**configuration_settings)
15
- configuration_settings[:verifier_email] = FFaker::Internet.email unless configuration_settings[:verifier_email]
16
- Truemail::Configuration.new(&configuration_block(configuration_settings))
15
+ configuration_settings[:verifier_email] = Faker::Internet.email unless configuration_settings[:verifier_email]
16
+ Truemail::Configuration.new(&configuration_block(**configuration_settings))
17
17
  end
18
18
  end
19
19
  end
@@ -4,17 +4,18 @@ module Truemail
4
4
  module RSpec
5
5
  module ValidatorHelper
6
6
  def create_servers_list
7
- Array.new(rand(1..4)) { FFaker::Internet.ip_v4_address }
7
+ Array.new(rand(1..4)) { Faker::Internet.ip_v4_address }
8
8
  end
9
9
 
10
- def create_validator(
10
+ def create_validator( # rubocop:disable Metrics/ParameterLists
11
11
  validation_type = nil,
12
- email = FFaker::Internet.email,
12
+ email = Faker::Internet.email,
13
13
  mail_servers = create_servers_list,
14
+ rcptto_error: 'user not found',
14
15
  success: true,
15
16
  configuration: create_configuration
16
17
  )
17
- set_expected_result(validation_type, email, mail_servers, success, configuration)
18
+ set_expected_result(validation_type, email, mail_servers, success, configuration, rcptto_error)
18
19
  stub_validation_layers
19
20
  validator_instance = ValidatorFactory.call(validation_type, success, email, configuration)
20
21
  unstub_validation_layers
@@ -23,14 +24,15 @@ module Truemail
23
24
 
24
25
  private
25
26
 
26
- attr_reader :validation_type, :email, :success, :configuration, :mail_servers
27
+ attr_reader :validation_type, :email, :success, :configuration, :mail_servers, :rcptto_error
27
28
 
28
- def set_expected_result(validation_type, email, mail_servers, success, configuration)
29
+ def set_expected_result(validation_type, email, mail_servers, success, configuration, rcptto_error) # rubocop:disable Metrics/ParameterLists
29
30
  @validation_type = validation_type
30
31
  @email = email
31
32
  @mail_servers = mail_servers
32
33
  @success = success
33
34
  @configuration = configuration
35
+ @rcptto_error = rcptto_error
34
36
  end
35
37
 
36
38
  def stub_validation_layers
@@ -41,7 +43,7 @@ module Truemail
41
43
  end
42
44
  end
43
45
 
44
- def unstub_validation_layers
46
+ def unstub_validation_layers # rubocop:disable Metrics/AbcSize
45
47
  allow_any_instance_of(Truemail::Validate::Regex).to receive(:match_regex_pattern?).and_call_original
46
48
  allow(Truemail::Validate::Regex).to receive(:check).and_call_original
47
49
  allow_any_instance_of(Truemail::Validate::Mx).to receive(:mx_records).and_call_original
@@ -74,13 +76,13 @@ module Truemail
74
76
  response.helo = true
75
77
  response.mailfrom = true
76
78
  response.rcptto = false
77
- response.errors[:rcptto] = 'user not found'
79
+ response.errors[:rcptto] = rcptto_error
78
80
  end
79
81
 
80
82
  request
81
83
  end
82
84
 
83
- def smtp_layer
85
+ def smtp_layer # rubocop:disable Metrics/AbcSize
84
86
  allow(Truemail::Validate::Regex).to receive(:check).and_return(true)
85
87
  allow_any_instance_of(Truemail::Validate::Mx).to receive(:mx_records).and_return(mail_servers)
86
88
  allow_any_instance_of(Truemail::Validate::Mx).to receive(:domain_not_include_null_mx).and_return(true)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Truemail
4
4
  module RSpec
5
- VERSION = '0.1.2'
5
+ VERSION = '0.3.1'
6
6
  end
7
7
  end
@@ -16,6 +16,14 @@ Gem::Specification.new do |spec|
16
16
  spec.homepage = 'https://github.com/truemail-rb/truemail-rspec'
17
17
  spec.license = 'MIT'
18
18
 
19
+ spec.metadata = {
20
+ 'homepage_uri' => 'https://truemail-rb.org',
21
+ 'changelog_uri' => 'https://github.com/truemail-rb/truemail-rspec/blob/master/CHANGELOG.md',
22
+ 'source_code_uri' => 'https://github.com/truemail-rb/truemail-rspec',
23
+ 'documentation_uri' => 'https://truemail-rb.org/truemail-rspec',
24
+ 'bug_tracker_uri' => 'https://github.com/truemail-rb/truemail-rspec/issues'
25
+ }
26
+
19
27
  spec.required_ruby_version = '>= 2.5.0'
20
28
 
21
29
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -24,17 +32,19 @@ Gem::Specification.new do |spec|
24
32
  spec.require_paths = ['lib']
25
33
 
26
34
  spec.add_development_dependency 'bundler', '~> 1.16'
27
- spec.add_development_dependency 'bundler-audit', '~> 0.6.1'
35
+ spec.add_development_dependency 'bundler-audit', '~> 0.7.0.1'
36
+ spec.add_development_dependency 'faker', '~> 2.15', '>= 2.15.1'
28
37
  spec.add_development_dependency 'fasterer', '~> 0.8.3'
29
- spec.add_development_dependency 'ffaker', '~> 2.14'
30
- spec.add_development_dependency 'overcommit', '~> 0.53.0'
38
+ spec.add_development_dependency 'overcommit', '~> 0.57.0'
31
39
  spec.add_development_dependency 'pry-byebug', '~> 3.9'
32
40
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
33
- spec.add_development_dependency 'reek', '~> 6.0'
34
- spec.add_development_dependency 'rspec', '~> 3.9'
35
- spec.add_development_dependency 'rubocop', '~> 0.76.0'
36
- spec.add_development_dependency 'rubocop-rspec', '~> 1.36'
41
+ spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.2'
42
+ spec.add_development_dependency 'rspec', '~> 3.10'
43
+ spec.add_development_dependency 'rubocop', '~> 1.5', '>= 1.5.2'
44
+ spec.add_development_dependency 'rubocop-performance', '~> 1.9', '>= 1.9.1'
45
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.0', '>= 2.0.1'
37
46
  spec.add_development_dependency 'simplecov', '~> 0.17.1'
38
- spec.add_runtime_dependency 'rspec', '~> 3.9'
39
- spec.add_runtime_dependency 'truemail', '~> 1.4', '>= 1.4.1'
47
+ spec.add_runtime_dependency 'faker', '~> 2.15', '>= 2.15.1'
48
+ spec.add_runtime_dependency 'rspec', '~> 3.10'
49
+ spec.add_runtime_dependency 'truemail', '~> 2.2'
40
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: truemail-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Trotsenko
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-07 00:00:00.000000000 Z
11
+ date: 2020-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,56 +30,62 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.6.1
33
+ version: 0.7.0.1
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.6.1
40
+ version: 0.7.0.1
41
41
  - !ruby/object:Gem::Dependency
42
- name: fasterer
42
+ name: faker
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.8.3
47
+ version: '2.15'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 2.15.1
48
51
  type: :development
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - "~>"
53
56
  - !ruby/object:Gem::Version
54
- version: 0.8.3
57
+ version: '2.15'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 2.15.1
55
61
  - !ruby/object:Gem::Dependency
56
- name: ffaker
62
+ name: fasterer
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: '2.14'
67
+ version: 0.8.3
62
68
  type: :development
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: '2.14'
74
+ version: 0.8.3
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: overcommit
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
79
  - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: 0.53.0
81
+ version: 0.57.0
76
82
  type: :development
77
83
  prerelease: false
78
84
  version_requirements: !ruby/object:Gem::Requirement
79
85
  requirements:
80
86
  - - "~>"
81
87
  - !ruby/object:Gem::Version
82
- version: 0.53.0
88
+ version: 0.57.0
83
89
  - !ruby/object:Gem::Dependency
84
90
  name: pry-byebug
85
91
  requirement: !ruby/object:Gem::Requirement
@@ -121,6 +127,9 @@ dependencies:
121
127
  - - "~>"
122
128
  - !ruby/object:Gem::Version
123
129
  version: '6.0'
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 6.0.2
124
133
  type: :development
125
134
  prerelease: false
126
135
  version_requirements: !ruby/object:Gem::Requirement
@@ -128,48 +137,83 @@ dependencies:
128
137
  - - "~>"
129
138
  - !ruby/object:Gem::Version
130
139
  version: '6.0'
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: 6.0.2
131
143
  - !ruby/object:Gem::Dependency
132
144
  name: rspec
133
145
  requirement: !ruby/object:Gem::Requirement
134
146
  requirements:
135
147
  - - "~>"
136
148
  - !ruby/object:Gem::Version
137
- version: '3.9'
149
+ version: '3.10'
138
150
  type: :development
139
151
  prerelease: false
140
152
  version_requirements: !ruby/object:Gem::Requirement
141
153
  requirements:
142
154
  - - "~>"
143
155
  - !ruby/object:Gem::Version
144
- version: '3.9'
156
+ version: '3.10'
145
157
  - !ruby/object:Gem::Dependency
146
158
  name: rubocop
147
159
  requirement: !ruby/object:Gem::Requirement
148
160
  requirements:
149
161
  - - "~>"
150
162
  - !ruby/object:Gem::Version
151
- version: 0.76.0
163
+ version: '1.5'
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: 1.5.2
167
+ type: :development
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.5'
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: 1.5.2
177
+ - !ruby/object:Gem::Dependency
178
+ name: rubocop-performance
179
+ requirement: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - "~>"
182
+ - !ruby/object:Gem::Version
183
+ version: '1.9'
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: 1.9.1
152
187
  type: :development
153
188
  prerelease: false
154
189
  version_requirements: !ruby/object:Gem::Requirement
155
190
  requirements:
156
191
  - - "~>"
157
192
  - !ruby/object:Gem::Version
158
- version: 0.76.0
193
+ version: '1.9'
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: 1.9.1
159
197
  - !ruby/object:Gem::Dependency
160
198
  name: rubocop-rspec
161
199
  requirement: !ruby/object:Gem::Requirement
162
200
  requirements:
163
201
  - - "~>"
164
202
  - !ruby/object:Gem::Version
165
- version: '1.36'
203
+ version: '2.0'
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: 2.0.1
166
207
  type: :development
167
208
  prerelease: false
168
209
  version_requirements: !ruby/object:Gem::Requirement
169
210
  requirements:
170
211
  - - "~>"
171
212
  - !ruby/object:Gem::Version
172
- version: '1.36'
213
+ version: '2.0'
214
+ - - ">="
215
+ - !ruby/object:Gem::Version
216
+ version: 2.0.1
173
217
  - !ruby/object:Gem::Dependency
174
218
  name: simplecov
175
219
  requirement: !ruby/object:Gem::Requirement
@@ -184,40 +228,54 @@ dependencies:
184
228
  - - "~>"
185
229
  - !ruby/object:Gem::Version
186
230
  version: 0.17.1
231
+ - !ruby/object:Gem::Dependency
232
+ name: faker
233
+ requirement: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - "~>"
236
+ - !ruby/object:Gem::Version
237
+ version: '2.15'
238
+ - - ">="
239
+ - !ruby/object:Gem::Version
240
+ version: 2.15.1
241
+ type: :runtime
242
+ prerelease: false
243
+ version_requirements: !ruby/object:Gem::Requirement
244
+ requirements:
245
+ - - "~>"
246
+ - !ruby/object:Gem::Version
247
+ version: '2.15'
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: 2.15.1
187
251
  - !ruby/object:Gem::Dependency
188
252
  name: rspec
189
253
  requirement: !ruby/object:Gem::Requirement
190
254
  requirements:
191
255
  - - "~>"
192
256
  - !ruby/object:Gem::Version
193
- version: '3.9'
257
+ version: '3.10'
194
258
  type: :runtime
195
259
  prerelease: false
196
260
  version_requirements: !ruby/object:Gem::Requirement
197
261
  requirements:
198
262
  - - "~>"
199
263
  - !ruby/object:Gem::Version
200
- version: '3.9'
264
+ version: '3.10'
201
265
  - !ruby/object:Gem::Dependency
202
266
  name: truemail
203
267
  requirement: !ruby/object:Gem::Requirement
204
268
  requirements:
205
269
  - - "~>"
206
270
  - !ruby/object:Gem::Version
207
- version: '1.4'
208
- - - ">="
209
- - !ruby/object:Gem::Version
210
- version: 1.4.1
271
+ version: '2.2'
211
272
  type: :runtime
212
273
  prerelease: false
213
274
  version_requirements: !ruby/object:Gem::Requirement
214
275
  requirements:
215
276
  - - "~>"
216
277
  - !ruby/object:Gem::Version
217
- version: '1.4'
218
- - - ">="
219
- - !ruby/object:Gem::Version
220
- version: 1.4.1
278
+ version: '2.2'
221
279
  description: Truemail RSpec helpers
222
280
  email:
223
281
  - admin@bestweb.com.ua
@@ -227,7 +285,11 @@ extra_rdoc_files: []
227
285
  files:
228
286
  - ".circleci/config.yml"
229
287
  - ".codeclimate.yml"
230
- - ".github/ISSUE_TEMPLATE.md"
288
+ - ".github/BRANCH_NAMING_CONVENTION.md"
289
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
290
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
291
+ - ".github/ISSUE_TEMPLATE/issue_report.md"
292
+ - ".github/ISSUE_TEMPLATE/question.md"
231
293
  - ".github/PULL_REQUEST_TEMPLATE.md"
232
294
  - ".gitignore"
233
295
  - ".overcommit.yml"
@@ -247,6 +309,7 @@ files:
247
309
  - bin/console
248
310
  - bin/setup
249
311
  - lib/truemail/rspec.rb
312
+ - lib/truemail/rspec/auditor_helper.rb
250
313
  - lib/truemail/rspec/configuration_helper.rb
251
314
  - lib/truemail/rspec/validator_helper.rb
252
315
  - lib/truemail/rspec/version.rb
@@ -254,8 +317,13 @@ files:
254
317
  homepage: https://github.com/truemail-rb/truemail-rspec
255
318
  licenses:
256
319
  - MIT
257
- metadata: {}
258
- post_install_message:
320
+ metadata:
321
+ homepage_uri: https://truemail-rb.org
322
+ changelog_uri: https://github.com/truemail-rb/truemail-rspec/blob/master/CHANGELOG.md
323
+ source_code_uri: https://github.com/truemail-rb/truemail-rspec
324
+ documentation_uri: https://truemail-rb.org/truemail-rspec
325
+ bug_tracker_uri: https://github.com/truemail-rb/truemail-rspec/issues
326
+ post_install_message:
259
327
  rdoc_options: []
260
328
  require_paths:
261
329
  - lib
@@ -270,9 +338,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
338
  - !ruby/object:Gem::Version
271
339
  version: '0'
272
340
  requirements: []
273
- rubyforge_project:
274
- rubygems_version: 2.7.9
275
- signing_key:
341
+ rubyforge_project:
342
+ rubygems_version: 2.7.3
343
+ signing_key:
276
344
  specification_version: 4
277
345
  summary: truemail-rspec
278
346
  test_files: []