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.
- checksums.yaml +4 -4
- data/.codeclimate.yml +1 -0
- data/.github/BRANCH_NAMING_CONVENTION.md +36 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +28 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +27 -0
- data/.github/{ISSUE_TEMPLATE.md → ISSUE_TEMPLATE/issue_report.md} +16 -5
- data/.github/ISSUE_TEMPLATE/question.md +22 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +3 -0
- data/.reek.yml +6 -0
- data/.rubocop.yml +217 -13
- data/CHANGELOG.md +58 -0
- data/CONTRIBUTING.md +15 -14
- data/Gemfile.lock +64 -49
- data/LICENSE.txt +1 -1
- data/README.md +44 -13
- data/lib/truemail/rspec.rb +2 -0
- data/lib/truemail/rspec/auditor_helper.rb +20 -0
- data/lib/truemail/rspec/configuration_helper.rb +2 -2
- data/lib/truemail/rspec/validator_helper.rb +11 -9
- data/lib/truemail/rspec/version.rb +1 -1
- data/truemail-rspec.gemspec +19 -9
- metadata +103 -35
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,64 @@
|
|
1
1
|
# Changelog
|
2
2
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
3
3
|
|
4
|
+
## [0.3.1] - 2020-12-06
|
5
|
+
|
6
|
+
### Added
|
7
|
+
|
8
|
+
- Required `faker` runtime dependency
|
9
|
+
|
10
|
+
## [0.3.0] - 2020-12-06
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
Ability to pass custom context into rcptto error:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
create_validator(
|
18
|
+
validation_type, # optional, type:Symbol, can be :regex, :mx or :smtp, by default creates :smtp validation
|
19
|
+
email, # optional, type:String, by default random email
|
20
|
+
mail_servers, # optional, type:Array(String), by default array with random ip addresses
|
21
|
+
success: true, # optional, type:Bool, by default true
|
22
|
+
rcptto_error: 'custom context of rcptto error' # optional, type:String, by default it's equal to 'user not found'
|
23
|
+
configuration: create_configuration # optional, type:Truemail::Configuration, by default creates random configuration
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
27
|
+
### Changed
|
28
|
+
|
29
|
+
- Updated `Truemail::RSpec::ValidatorHelper`
|
30
|
+
- gem development, runtime dependencies
|
31
|
+
- gem documentation
|
32
|
+
|
33
|
+
## [0.2.1] - 2020-09-21
|
34
|
+
|
35
|
+
### Changed
|
36
|
+
|
37
|
+
Migrated to updated Ruby 2.7.x syntax.
|
38
|
+
|
39
|
+
- Updated `Truemail::RSpec::ConfigurationHelper`
|
40
|
+
|
41
|
+
## [0.2.0] - 2020-08-31
|
42
|
+
|
43
|
+
### Added
|
44
|
+
|
45
|
+
- auditor RSpec helper
|
46
|
+
|
47
|
+
### Removed
|
48
|
+
|
49
|
+
- gem public documentation
|
50
|
+
|
51
|
+
## [0.1.3] - 2020-08-24
|
52
|
+
|
53
|
+
### Added
|
54
|
+
|
55
|
+
- gem public documentation
|
56
|
+
|
57
|
+
### Changed
|
58
|
+
|
59
|
+
- gem development dependencies
|
60
|
+
- linters configs
|
61
|
+
|
4
62
|
## [0.1.2] - 2020-05-08
|
5
63
|
|
6
64
|
### Changed
|
data/CONTRIBUTING.md
CHANGED
@@ -6,28 +6,28 @@ Following these guidelines helps to communicate that you respect the time of the
|
|
6
6
|
|
7
7
|
## Using the issue tracker
|
8
8
|
|
9
|
-
The issue tracker is the preferred channel for [bug reports](#
|
9
|
+
The issue tracker is the preferred channel for [issue/bug reports](#issuebug-reports), [feature requests](#feature-requests), [questions](#questions) and submitting [pull requests](#pull-requests).
|
10
10
|
|
11
|
-
|
12
|
-
## Bug/issue reports
|
11
|
+
## Issue/bug reports
|
13
12
|
|
14
|
-
A bug is a _demonstrable problem_ that is caused by the code in the repository.
|
15
|
-
Good bug reports are extremely helpful - thank you!
|
13
|
+
A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!
|
16
14
|
|
17
|
-
Guidelines for bug reports:
|
15
|
+
Guidelines for issue/bug reports:
|
18
16
|
|
19
17
|
1. **Use the GitHub issue search** — check if the issue has already been reported
|
20
|
-
2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or
|
21
|
-
3. Truemail [issue template](.github/ISSUE_TEMPLATE.md)
|
18
|
+
2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or `develop` branch in the repository
|
19
|
+
3. Truemail [issue template](.github/ISSUE_TEMPLATE/issue_report.md)/[bug template](.github/ISSUE_TEMPLATE/bug_report.md)
|
22
20
|
|
23
21
|
A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What would you expect to be the outcome? All these details will help people to fix any potential bugs.
|
24
22
|
|
25
|
-
<a name="features"></a>
|
26
23
|
## Feature requests
|
27
24
|
|
28
25
|
Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.
|
29
26
|
|
30
|
-
|
27
|
+
## Questions
|
28
|
+
|
29
|
+
We're always open to a new conversations. So if you have any questions just ask us.
|
30
|
+
|
31
31
|
## Pull requests
|
32
32
|
|
33
33
|
Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
|
@@ -39,7 +39,8 @@ Please adhere to the coding conventions used throughout a project (indentation,
|
|
39
39
|
Guidelines for pull requests:
|
40
40
|
|
41
41
|
1. Truemail [pull request template](.github/PULL_REQUEST_TEMPLATE.md)
|
42
|
-
2. Fork the repo
|
43
|
-
3. Run the tests. This is to make sure your starting point works
|
44
|
-
4.
|
45
|
-
5.
|
42
|
+
2. Fork the repo, checkout to `develop` branch
|
43
|
+
3. Run the tests. This is to make sure your starting point works
|
44
|
+
4. Read our [branch naming convention](.github/BRANCH_NAMING_CONVENTION.md)
|
45
|
+
5. Create a new branch and make your changes. This includes tests for features!
|
46
|
+
6. Push to your fork and submit a pull request to `develop` branch
|
data/Gemfile.lock
CHANGED
@@ -1,78 +1,92 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
truemail-rspec (0.1
|
5
|
-
|
6
|
-
|
4
|
+
truemail-rspec (0.3.1)
|
5
|
+
faker (~> 2.15, >= 2.15.1)
|
6
|
+
rspec (~> 3.10)
|
7
|
+
truemail (~> 2.2)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
11
|
-
ast (2.4.
|
12
|
-
bundler-audit (0.
|
12
|
+
ast (2.4.1)
|
13
|
+
bundler-audit (0.7.0.1)
|
13
14
|
bundler (>= 1.2.0, < 3)
|
14
|
-
thor (
|
15
|
+
thor (>= 0.18, < 2)
|
15
16
|
byebug (11.1.3)
|
16
|
-
childprocess (
|
17
|
-
coderay (1.1.
|
17
|
+
childprocess (4.0.0)
|
18
|
+
coderay (1.1.3)
|
18
19
|
colorize (0.8.1)
|
19
|
-
|
20
|
+
concurrent-ruby (1.1.7)
|
21
|
+
diff-lcs (1.4.4)
|
20
22
|
docile (1.3.2)
|
23
|
+
faker (2.15.1)
|
24
|
+
i18n (>= 1.6, < 2)
|
21
25
|
fasterer (0.8.3)
|
22
26
|
colorize (~> 0.7)
|
23
27
|
ruby_parser (>= 3.14.1)
|
24
|
-
|
28
|
+
i18n (1.8.5)
|
29
|
+
concurrent-ruby (~> 1.0)
|
25
30
|
iniparse (1.5.0)
|
26
|
-
|
27
|
-
json (2.3.0)
|
31
|
+
json (2.3.1)
|
28
32
|
kwalify (0.7.2)
|
29
33
|
method_source (1.0.0)
|
30
|
-
overcommit (0.
|
31
|
-
childprocess (>= 0.6.3, <
|
34
|
+
overcommit (0.57.0)
|
35
|
+
childprocess (>= 0.6.3, < 5)
|
32
36
|
iniparse (~> 1.4)
|
33
|
-
parallel (1.
|
34
|
-
parser (2.7.
|
35
|
-
ast (~> 2.4.
|
37
|
+
parallel (1.20.1)
|
38
|
+
parser (2.7.2.0)
|
39
|
+
ast (~> 2.4.1)
|
36
40
|
pry (0.13.1)
|
37
41
|
coderay (~> 1.1)
|
38
42
|
method_source (~> 1.0)
|
39
43
|
pry-byebug (3.9.0)
|
40
44
|
byebug (~> 11.0)
|
41
45
|
pry (~> 0.13.0)
|
42
|
-
psych (3.
|
46
|
+
psych (3.2.0)
|
43
47
|
rainbow (3.0.0)
|
44
48
|
rake (13.0.1)
|
45
|
-
reek (6.0.
|
49
|
+
reek (6.0.2)
|
46
50
|
kwalify (~> 0.7.0)
|
47
51
|
parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
|
48
|
-
psych (~> 3.1
|
52
|
+
psych (~> 3.1)
|
49
53
|
rainbow (>= 2.0, < 4.0)
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
rspec-
|
54
|
-
|
55
|
-
rspec-
|
56
|
-
rspec-
|
54
|
+
regexp_parser (2.0.0)
|
55
|
+
rexml (3.2.4)
|
56
|
+
rspec (3.10.0)
|
57
|
+
rspec-core (~> 3.10.0)
|
58
|
+
rspec-expectations (~> 3.10.0)
|
59
|
+
rspec-mocks (~> 3.10.0)
|
60
|
+
rspec-core (3.10.0)
|
61
|
+
rspec-support (~> 3.10.0)
|
62
|
+
rspec-expectations (3.10.0)
|
57
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
-
rspec-support (~> 3.
|
59
|
-
rspec-mocks (3.
|
64
|
+
rspec-support (~> 3.10.0)
|
65
|
+
rspec-mocks (3.10.0)
|
60
66
|
diff-lcs (>= 1.2.0, < 2.0)
|
61
|
-
rspec-support (~> 3.
|
62
|
-
rspec-support (3.
|
63
|
-
rubocop (
|
64
|
-
jaro_winkler (~> 1.5.1)
|
67
|
+
rspec-support (~> 3.10.0)
|
68
|
+
rspec-support (3.10.0)
|
69
|
+
rubocop (1.5.2)
|
65
70
|
parallel (~> 1.10)
|
66
|
-
parser (>= 2.
|
71
|
+
parser (>= 2.7.1.5)
|
67
72
|
rainbow (>= 2.2.2, < 4.0)
|
73
|
+
regexp_parser (>= 1.8, < 3.0)
|
74
|
+
rexml
|
75
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
68
76
|
ruby-progressbar (~> 1.7)
|
69
|
-
unicode-display_width (>= 1.4.0, <
|
70
|
-
rubocop-
|
71
|
-
|
77
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
78
|
+
rubocop-ast (1.3.0)
|
79
|
+
parser (>= 2.7.1.5)
|
80
|
+
rubocop-performance (1.9.1)
|
81
|
+
rubocop (>= 0.90.0, < 2.0)
|
82
|
+
rubocop-ast (>= 0.4.0)
|
83
|
+
rubocop-rspec (2.0.1)
|
84
|
+
rubocop (~> 1.0)
|
85
|
+
rubocop-ast (>= 1.1.0)
|
72
86
|
ruby-progressbar (1.10.1)
|
73
|
-
ruby_parser (3.
|
87
|
+
ruby_parser (3.15.0)
|
74
88
|
sexp_processor (~> 4.9)
|
75
|
-
sexp_processor (4.
|
89
|
+
sexp_processor (4.15.1)
|
76
90
|
simplecov (0.17.1)
|
77
91
|
docile (~> 1.1)
|
78
92
|
json (>= 1.8, < 3)
|
@@ -80,29 +94,30 @@ GEM
|
|
80
94
|
simplecov-html (0.10.2)
|
81
95
|
simpleidn (0.1.1)
|
82
96
|
unf (~> 0.1.4)
|
83
|
-
thor (0.
|
84
|
-
truemail (
|
97
|
+
thor (1.0.1)
|
98
|
+
truemail (2.2.0)
|
85
99
|
simpleidn (~> 0.1.1)
|
86
100
|
unf (0.1.4)
|
87
101
|
unf_ext
|
88
102
|
unf_ext (0.0.7.7)
|
89
|
-
unicode-display_width (1.
|
103
|
+
unicode-display_width (1.7.0)
|
90
104
|
|
91
105
|
PLATFORMS
|
92
106
|
ruby
|
93
107
|
|
94
108
|
DEPENDENCIES
|
95
109
|
bundler (~> 1.16)
|
96
|
-
bundler-audit (~> 0.
|
110
|
+
bundler-audit (~> 0.7.0.1)
|
111
|
+
faker (~> 2.15, >= 2.15.1)
|
97
112
|
fasterer (~> 0.8.3)
|
98
|
-
|
99
|
-
overcommit (~> 0.53.0)
|
113
|
+
overcommit (~> 0.57.0)
|
100
114
|
pry-byebug (~> 3.9)
|
101
115
|
rake (~> 13.0, >= 13.0.1)
|
102
|
-
reek (~> 6.0)
|
103
|
-
rspec (~> 3.
|
104
|
-
rubocop (~>
|
105
|
-
rubocop-
|
116
|
+
reek (~> 6.0, >= 6.0.2)
|
117
|
+
rspec (~> 3.10)
|
118
|
+
rubocop (~> 1.5, >= 1.5.2)
|
119
|
+
rubocop-performance (~> 1.9, >= 1.9.1)
|
120
|
+
rubocop-rspec (~> 2.0, >= 2.0.1)
|
106
121
|
simplecov (~> 0.17.1)
|
107
122
|
truemail-rspec!
|
108
123
|
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,17 @@
|
|
1
|
-
#
|
1
|
+
# ![Truemail RSpec helpers](https://truemail-rb.org/assets/images/truemail_logo.png)
|
2
2
|
|
3
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/d23d82c1c1bdbc271b81/maintainability)](https://codeclimate.com/github/truemail-rb/truemail-rspec/maintainability)
|
3
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/d23d82c1c1bdbc271b81/maintainability)](https://codeclimate.com/github/truemail-rb/truemail-rspec/maintainability)
|
4
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/d23d82c1c1bdbc271b81/test_coverage)](https://codeclimate.com/github/truemail-rb/truemail-rspec/test_coverage)
|
5
|
+
[![CircleCI](https://circleci.com/gh/truemail-rb/truemail-rspec/tree/master.svg?style=svg)](https://circleci.com/gh/truemail-rb/truemail-rspec/tree/master)
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/truemail-rspec.svg)](https://badge.fury.io/rb/truemail-rspec)
|
7
|
+
[![Downloads](https://img.shields.io/gem/dt/truemail-rspec.svg?colorA=004d99&colorB=0073e6)](https://rubygems.org/gems/truemail-rspec)
|
8
|
+
[![Gitter](https://badges.gitter.im/truemail-rb/community.svg)](https://gitter.im/truemail-rb/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
9
|
+
[![GitHub](https://img.shields.io/github/license/truemail-rb/truemail-rspec)](LICENSE.txt)
|
10
|
+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
|
4
11
|
|
5
|
-
`truemail-rspec` gem helps you create `Truemail::Configuration` and `Truemail::Validator` instances for your RSpec environment.
|
12
|
+
`truemail-rspec` gem helps you to create `Truemail::Configuration`, `Truemail::Auditor` and `Truemail::Validator` instances for your RSpec environment.
|
13
|
+
|
14
|
+
> Actual and maintainable documentation :books: for developers is living [here](https://truemail-rb.org/truemail-rspec).
|
6
15
|
|
7
16
|
## Table of Contents
|
8
17
|
|
@@ -13,9 +22,11 @@
|
|
13
22
|
- [Create configuration instance](#create-configuration-instance)
|
14
23
|
- [Configuration instance with default random params](#configuration-instance-with-default-random-params)
|
15
24
|
- [Configuration instance with predefined params](#configuration-instance-with-predefined-params)
|
25
|
+
- [Create auditor instance](#create-auditor-instance)
|
26
|
+
- [create_auditor](#create-auditor)
|
16
27
|
- [Create validator instance](#create-validator-instance)
|
17
28
|
- [create_servers_list](#create_servers_list)
|
18
|
-
- [create_validator
|
29
|
+
- [create_validator](#create_validator)
|
19
30
|
- [Truemail family](#truemail-family)
|
20
31
|
- [Contributing](#contributing)
|
21
32
|
- [License](#license)
|
@@ -31,11 +42,12 @@ Ruby MRI 2.5.0+
|
|
31
42
|
## Features
|
32
43
|
|
33
44
|
- Ability to create `Truemail::Configuration` instance with random or with predefined params
|
45
|
+
- Ability to create `Truemail::Auditor` instance with random or with predefined params
|
34
46
|
- Ability to create `Truemail::Validator` instance with random or with predefined params
|
35
47
|
|
36
48
|
## Installation
|
37
49
|
|
38
|
-
Add this line to your application's Gemfile
|
50
|
+
Add this line to your application's `Gemfile`:
|
39
51
|
|
40
52
|
```ruby
|
41
53
|
group :development, :test do
|
@@ -65,7 +77,7 @@ Or install it yourself as:
|
|
65
77
|
|
66
78
|
### Create configuration instance
|
67
79
|
|
68
|
-
|
80
|
+
Allows to create configuration instance with random or with predefined params.
|
69
81
|
|
70
82
|
#### Configuration instance with default random params
|
71
83
|
|
@@ -85,9 +97,26 @@ create_configuration(verifier_email: 'email@domain.com', verifier_domain: 'other
|
|
85
97
|
# => returns Truemail::Configuration instance with custom settings
|
86
98
|
```
|
87
99
|
|
100
|
+
### Create auditor instance
|
101
|
+
|
102
|
+
Allows to create auditor instance with default random or with predefined params.
|
103
|
+
|
104
|
+
#### create_auditor
|
105
|
+
|
106
|
+
```ruby
|
107
|
+
create_auditor(
|
108
|
+
success: true, # optional, type:Bool, by default true
|
109
|
+
current_host_ip: current_host_ip, # optional, type:String, by default random IPv4 address
|
110
|
+
warnings: warnings, # optional, type:Hash, by default creates auditor result warnings
|
111
|
+
configuration: create_configuration # optional, type:Truemail::Configuration, by default creates random configuration
|
112
|
+
)
|
113
|
+
|
114
|
+
# => returns Truemail::Auditor instance follow passed params
|
115
|
+
```
|
116
|
+
|
88
117
|
### Create validator instance
|
89
118
|
|
90
|
-
|
119
|
+
Allows to create validator instance with default random or with predefined params.
|
91
120
|
|
92
121
|
#### create_servers_list
|
93
122
|
|
@@ -95,7 +124,7 @@ Allow to create validator instance with default random or with predefined params
|
|
95
124
|
create_servers_list # => returns array with random ip addresses
|
96
125
|
```
|
97
126
|
|
98
|
-
#### create_validator
|
127
|
+
#### create_validator
|
99
128
|
|
100
129
|
```ruby
|
101
130
|
create_validator(
|
@@ -103,6 +132,7 @@ create_validator(
|
|
103
132
|
email, # optional, type:String, by default random email
|
104
133
|
mail_servers, # optional, type:Array(String), by default array with random ip addresses
|
105
134
|
success: true, # optional, type:Bool, by default true
|
135
|
+
rcptto_error: 'custom context of rcptto error' # optional, type:String, by default it's equal to 'user not found'
|
106
136
|
configuration: create_configuration # optional, type:Truemail::Configuration, by default creates random configuration
|
107
137
|
)
|
108
138
|
|
@@ -113,15 +143,16 @@ create_validator(
|
|
113
143
|
|
114
144
|
## Truemail family
|
115
145
|
|
116
|
-
All Truemail
|
146
|
+
All Truemail solutions: https://truemail-rb.org
|
117
147
|
|
118
148
|
| Name | Type | Description |
|
119
149
|
| --- | --- | --- |
|
120
|
-
| [truemail](https://github.com/
|
121
|
-
| [truemail server](https://github.com/truemail-rb/truemail-rack) | ruby app | Lightweight rack based web API wrapper for Truemail |
|
150
|
+
| [truemail](https://github.com/truemail-rb/truemail) | ruby gem | Configurable framework agnostic plain Ruby email validator, main core |
|
151
|
+
| [truemail server](https://github.com/truemail-rb/truemail-rack) | ruby app | Lightweight rack based web API wrapper for Truemail gem |
|
122
152
|
| [truemail-rack-docker](https://github.com/truemail-rb/truemail-rack-docker-image) | docker image | Lightweight rack based web API [dockerized image](https://hub.docker.com/r/truemail/truemail-rack) :whale: of Truemail server |
|
123
|
-
| [truemail-ruby-client](https://github.com/truemail-rb/truemail-ruby-client) | ruby gem |
|
124
|
-
| [truemail-crystal-client](https://github.com/truemail-rb/truemail-crystal-client) | crystal shard |
|
153
|
+
| [truemail-ruby-client](https://github.com/truemail-rb/truemail-ruby-client) | ruby gem | Web API Ruby client for Truemail Server |
|
154
|
+
| [truemail-crystal-client](https://github.com/truemail-rb/truemail-crystal-client) | crystal shard | Web API Crystal client for Truemail Server |
|
155
|
+
| [truemail-java-client](https://github.com/truemail-rb/truemail-java-client) | java lib | Web API Java client for Truemail Server |
|
125
156
|
|
126
157
|
## Contributing
|
127
158
|
|
data/lib/truemail/rspec.rb
CHANGED
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
require 'truemail/rspec/version'
|
4
4
|
require 'truemail/rspec/configuration_helper'
|
5
|
+
require 'truemail/rspec/auditor_helper'
|
5
6
|
require 'truemail/rspec/validator_helper'
|
6
7
|
|
7
8
|
module Truemail
|
8
9
|
module RSpec
|
9
10
|
include Truemail::RSpec::ConfigurationHelper
|
11
|
+
include Truemail::RSpec::AuditorHelper
|
10
12
|
include Truemail::RSpec::ValidatorHelper
|
11
13
|
end
|
12
14
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Truemail
|
4
|
+
module RSpec
|
5
|
+
module AuditorHelper
|
6
|
+
def create_auditor(
|
7
|
+
success: true,
|
8
|
+
current_host_ip: Faker::Internet.ip_v4_address,
|
9
|
+
warnings: { ip: Truemail::Audit::Ip::IPIFY_ERROR },
|
10
|
+
configuration: create_configuration
|
11
|
+
)
|
12
|
+
Truemail::Auditor.new(configuration: configuration).tap do |auditor|
|
13
|
+
auditor_result = auditor.result
|
14
|
+
auditor_result.current_host_ip = current_host_ip if success
|
15
|
+
auditor_result.warnings = warnings unless success
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|