smtp_mock 1.3.0 → 1.3.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: 7ef287184c0a2ce277093e8d111ef9b96ff99ec63ca305fc58070cc4b6775885
4
- data.tar.gz: 25c9c9be786f4e4013bb350eb2b98e2b251f73e8bb463a5e42c060311473d053
3
+ metadata.gz: d37e8ce17d9dc8f782957fd32323c3932c8d209482ee20af50a6fb9e54e728d5
4
+ data.tar.gz: 84f77b8cb15d2a905447d0b10bac63adf9b6572b150d2133d889353a4d503cdc
5
5
  SHA512:
6
- metadata.gz: c90b886b1ddf65eb3ccbdadba35c541ec839f05ce00a28706ddbe6f6eb8c70acf6a9ec7faaaea957441a5fe7446182e8d700f065b20fdd0e2f0fb1a0b3e57b2a
7
- data.tar.gz: 0da05fd0464013947ce689ce751e61f6dd5bc0392e28ec220f5dc2b3cf70c9cedfebc3718047b0b30dacb36835f1687c662191564f063c633054a6a7602f0d9c
6
+ metadata.gz: 236236bcd69777430a75b52bdc4548152fdbbc82f68b8a052ced1201dd8f8e74e900fc18626fd9bdfb61963ebfb413a6a7723b8b5a9fdc62b085f1c2ab7e6288
7
+ data.tar.gz: f218bb2b1464a7a2c18b7074546e19cc2633e7eac354816c812dedd2f2bb4e392eee09a09ae37b6c0b4fa9dff86ff123bc5781bd1fcf01a4b77924e2f458b499
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmtpMock
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.1'
5
5
  end
data/smtp_mock.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
6
6
  spec.name = 'smtp_mock'
7
7
  spec.version = SmtpMock::VERSION
8
8
  spec.authors = ['Vladislav Trotsenko']
9
- spec.email = ['admin@bestweb.com.ua']
9
+ spec.email = %w[admin@bestweb.com.ua]
10
10
 
11
11
  spec.summary = %(smtp_mock)
12
12
  spec.description = %(💎 Ruby SMTP mock. Mimic any SMTP server behaviour for your test environment.)
@@ -22,12 +22,12 @@ Gem::Specification.new do |spec|
22
22
  'bug_tracker_uri' => 'https://github.com/mocktools/ruby-smtp-mock/issues'
23
23
  }
24
24
 
25
- spec.required_ruby_version = '>= 2.5.0'
26
25
  current_ruby_version = ::Gem::Version.new(::RUBY_VERSION)
27
26
  dry_struct_version = current_ruby_version >= ::Gem::Version.new('2.7.0') ? '~> 1.6' : '~> 1.4'
28
27
 
29
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
30
- spec.executables = %w[smtp_mock]
28
+ spec.required_ruby_version = '>= 2.5.0'
29
+ spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(bin|lib|tmp)/|.ruby-version|smtp_mock.gemspec|LICENSE}) }
30
+ spec.executables = %w[smtp_mock]
31
31
  spec.require_paths = %w[lib]
32
32
  spec.post_install_message = 'smtpmock is required system dependency. For more details run: `bundle exec smtp_mock -h`'
33
33
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smtp_mock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Trotsenko
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-19 00:00:00.000000000 Z
11
+ date: 2022-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -81,32 +81,8 @@ executables:
81
81
  extensions: []
82
82
  extra_rdoc_files: []
83
83
  files:
84
- - ".circleci/config.yml"
85
- - ".circleci/gemspec_compatible"
86
- - ".circleci/gemspec_latest"
87
- - ".codeclimate.yml"
88
- - ".github/BRANCH_NAMING_CONVENTION.md"
89
- - ".github/DEVELOPMENT_ENVIRONMENT_GUIDE.md"
90
- - ".github/FUNDING.yml"
91
- - ".github/ISSUE_TEMPLATE/bug_report.md"
92
- - ".github/ISSUE_TEMPLATE/feature_request.md"
93
- - ".github/ISSUE_TEMPLATE/issue_report.md"
94
- - ".github/ISSUE_TEMPLATE/question.md"
95
- - ".github/PULL_REQUEST_TEMPLATE.md"
96
- - ".gitignore"
97
- - ".overcommit.yml"
98
- - ".reek.yml"
99
- - ".rspec"
100
- - ".rubocop.yml"
101
- - ".ruby-gemset"
102
84
  - ".ruby-version"
103
- - CHANGELOG.md
104
- - CODE_OF_CONDUCT.md
105
- - CONTRIBUTING.md
106
- - Gemfile
107
85
  - LICENSE.txt
108
- - README.md
109
- - Rakefile
110
86
  - bin/console
111
87
  - bin/setup
112
88
  - bin/smtp_mock
@@ -153,8 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
129
  - !ruby/object:Gem::Version
154
130
  version: '0'
155
131
  requirements: []
156
- rubygems_version: 3.2.20
157
- signing_key:
132
+ rubygems_version: 3.2.15
133
+ signing_key:
158
134
  specification_version: 4
159
135
  summary: smtp_mock
160
136
  test_files: []
data/.circleci/config.yml DELETED
@@ -1,147 +0,0 @@
1
- version: 2.1
2
-
3
- defaults: &defaults
4
- working_directory: ~/ruby-smtp-mock
5
- docker:
6
- - image: cimg/ruby:<< parameters.ruby-version >>
7
-
8
- orbs:
9
- ruby: circleci/ruby@2.0.0
10
-
11
- references:
12
- restore_bundle_cache: &restore_bundle_cache
13
- restore_cache:
14
- keys:
15
- - ruby-smtp-mock-{{ checksum "smtp_mock.gemspec" }}
16
-
17
- bundle_install: &bundle_install
18
- run:
19
- name: Installing gems
20
- command: |
21
- bundle config set --local path 'vendor/bundle'
22
- bundle install
23
-
24
- save_bundle_cache: &save_bundle_cache
25
- save_cache:
26
- key: ruby-smtp-mock-{{ checksum "smtp_mock.gemspec" }}
27
- paths:
28
- - vendor/bundle
29
-
30
- system_dependencies: &system_dependencies
31
- run:
32
- name: Installing system requirements
33
- command: |
34
- bundle exec smtp_mock -s -i ~
35
-
36
- install_codeclimate_reporter: &install_codeclimate_reporter
37
- run:
38
- name: Installing CodeClimate test reporter
39
- command: |
40
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
41
- chmod +x ./cc-test-reporter
42
-
43
- use_latest_gemspec: &use_latest_gemspec
44
- run:
45
- name: Using latest gemspec
46
- command: |
47
- cp .circleci/gemspec_latest smtp_mock.gemspec
48
-
49
- use_compatible_gemspec: &use_compatible_gemspec
50
- run:
51
- name: Using compatible gemspec
52
- command: |
53
- cp .circleci/gemspec_compatible smtp_mock.gemspec
54
-
55
- jobs:
56
- linters-ruby:
57
- parameters:
58
- ruby-version:
59
- type: string
60
-
61
- <<: *defaults
62
-
63
- steps:
64
- - checkout
65
-
66
- - <<: *use_latest_gemspec
67
- - <<: *restore_bundle_cache
68
- - <<: *bundle_install
69
- - <<: *save_bundle_cache
70
-
71
- - run:
72
- name: Running Overcommit
73
- command: |
74
- bundle exec overcommit -s
75
- SKIP=AuthorEmail,AuthorName bundle exec overcommit -r
76
-
77
- tests-ruby:
78
- parameters:
79
- ruby-version:
80
- type: string
81
-
82
- <<: *defaults
83
-
84
- steps:
85
- - checkout
86
-
87
- - <<: *use_latest_gemspec
88
- - <<: *restore_bundle_cache
89
- - <<: *bundle_install
90
- - <<: *save_bundle_cache
91
- - <<: *system_dependencies
92
- - <<: *install_codeclimate_reporter
93
-
94
- - run:
95
- name: Running RSpec
96
- command: |
97
- ./cc-test-reporter before-build
98
- bundle exec rspec
99
-
100
- - run:
101
- name: Creating CodeClimate test coverage report
102
- command: |
103
- ./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
104
-
105
- - store_artifacts:
106
- name: Saving Simplecov coverage artifacts
107
- path: ~/ruby-smtp-mock/coverage
108
- destination: coverage
109
-
110
- - deploy:
111
- name: Uploading CodeClimate test coverage report
112
- command: |
113
- ./cc-test-reporter sum-coverage --output - --parts $CIRCLE_NODE_TOTAL coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage --debug --input -
114
-
115
- compatibility-ruby:
116
- parameters:
117
- ruby-version:
118
- type: string
119
- docker:
120
- - image: cimg/ruby:<< parameters.ruby-version >>
121
- steps:
122
- - checkout
123
- - <<: *use_compatible_gemspec
124
- - ruby/install-deps:
125
- bundler-version: "2.3.26"
126
- with-cache: false
127
- path: './vendor/custom_bundle'
128
- - <<: *system_dependencies
129
- - run:
130
- name: Running compatibility tests
131
- command: bundle exec rspec
132
-
133
- workflows:
134
- build_and_test:
135
- jobs:
136
- - linters-ruby:
137
- matrix:
138
- parameters:
139
- ruby-version: ["3.1"]
140
- - tests-ruby:
141
- matrix:
142
- parameters:
143
- ruby-version: ["3.1"]
144
- - compatibility-ruby:
145
- matrix:
146
- parameters:
147
- ruby-version: ["2.5", "2.6", "2.7", "3.0"]
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/smtp_mock/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'smtp_mock'
7
- spec.version = SmtpMock::VERSION
8
- spec.authors = ['Vladislav Trotsenko']
9
- spec.email = ['admin@bestweb.com.ua']
10
-
11
- spec.summary = %(smtp_mock)
12
- spec.description = %(💎 Ruby SMTP mock. Mimic any SMTP server behaviour for your test environment.)
13
-
14
- spec.homepage = 'https://github.com/mocktools/ruby-smtp-mock'
15
- spec.license = 'MIT'
16
-
17
- spec.metadata = {
18
- 'homepage_uri' => 'https://github.com/mocktools/ruby-smtp-mock',
19
- 'changelog_uri' => 'https://github.com/mocktools/ruby-smtp-mock/blob/master/CHANGELOG.md',
20
- 'source_code_uri' => 'https://github.com/mocktools/ruby-smtp-mock',
21
- 'documentation_uri' => 'https://github.com/mocktools/ruby-smtp-mock/blob/master/README.md',
22
- 'bug_tracker_uri' => 'https://github.com/mocktools/ruby-smtp-mock/issues'
23
- }
24
-
25
- spec.required_ruby_version = '>= 2.5.0'
26
- dry_struct_version = ::Gem::Version.new(::RUBY_VERSION) >= ::Gem::Version.new('2.7.0') ? '~> 1.6' : '~> 1.4'
27
-
28
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
29
- spec.executables = %w[smtp_mock]
30
- spec.require_paths = %w[lib]
31
-
32
- spec.add_runtime_dependency 'dry-struct', dry_struct_version
33
-
34
- spec.add_development_dependency 'ffaker', '~> 2.21'
35
- spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
36
- spec.add_development_dependency 'rspec', '~> 3.12'
37
- end
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/smtp_mock/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'smtp_mock'
7
- spec.version = SmtpMock::VERSION
8
- spec.authors = ['Vladislav Trotsenko']
9
- spec.email = ['admin@bestweb.com.ua']
10
-
11
- spec.summary = %(smtp_mock)
12
- spec.description = %(💎 Ruby SMTP mock. Mimic any SMTP server behaviour for your test environment.)
13
-
14
- spec.homepage = 'https://github.com/mocktools/ruby-smtp-mock'
15
- spec.license = 'MIT'
16
-
17
- spec.metadata = {
18
- 'homepage_uri' => 'https://github.com/mocktools/ruby-smtp-mock',
19
- 'changelog_uri' => 'https://github.com/mocktools/ruby-smtp-mock/blob/master/CHANGELOG.md',
20
- 'source_code_uri' => 'https://github.com/mocktools/ruby-smtp-mock',
21
- 'documentation_uri' => 'https://github.com/mocktools/ruby-smtp-mock/blob/master/README.md',
22
- 'bug_tracker_uri' => 'https://github.com/mocktools/ruby-smtp-mock/issues'
23
- }
24
-
25
- spec.required_ruby_version = '>= 2.5.0'
26
-
27
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
- spec.executables = %w[smtp_mock]
29
- spec.require_paths = %w[lib]
30
- spec.post_install_message = 'smtpmock is required system dependency. For more details run: `bundle exec smtp_mock -h`'
31
-
32
- spec.add_runtime_dependency 'dry-struct', '~> 1.6'
33
-
34
- spec.add_development_dependency 'bundler-audit', '~> 0.9.1'
35
- spec.add_development_dependency 'fasterer', '~> 0.10.0'
36
- spec.add_development_dependency 'ffaker', '~> 2.21'
37
- spec.add_development_dependency 'net-smtp', '~> 0.3.3'
38
- spec.add_development_dependency 'overcommit', '~> 0.59.1'
39
- spec.add_development_dependency 'pry-byebug', '~> 3.10', '>= 3.10.1'
40
- spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
41
- spec.add_development_dependency 'reek', '~> 6.1', '>= 6.1.1'
42
- spec.add_development_dependency 'rspec', '~> 3.12'
43
- spec.add_development_dependency 'rubocop', '~> 1.39'
44
- spec.add_development_dependency 'rubocop-performance', '~> 1.15', '>= 1.15.1'
45
- spec.add_development_dependency 'rubocop-rspec', '~> 2.15'
46
- spec.add_development_dependency 'simplecov', '~> 0.21.2'
47
- end
data/.codeclimate.yml DELETED
@@ -1,13 +0,0 @@
1
- checks:
2
- argument-count:
3
- enabled: false
4
- method-complexity:
5
- enabled: false
6
-
7
- plugins:
8
- rubocop:
9
- enabled: true
10
- channel: rubocop-1-39
11
-
12
- reek:
13
- enabled: true
@@ -1,36 +0,0 @@
1
- # Branch naming convention
2
-
3
- ## Branch naming
4
-
5
- > Please note for new pull requests create new branches from current `develop` branch only.
6
-
7
- Branch name should include type of your contribution and context. Please follow next pattern for naming your branches:
8
-
9
- ```bash
10
- feature/add-some-feature
11
- technical/some-technical-improvements
12
- bugfix/fix-some-bug-name
13
- ```
14
-
15
- ## Before PR actions
16
-
17
- ### Squash commits
18
-
19
- Please squash all branch commits into the one before openning your PR from your fork. It's simple to do with the git:
20
-
21
- ```bash
22
- git rebase -i [hash your first commit of your branch]~1
23
- git rebase -i 6467fe36232401fa740af067cfd8ac9ec932fed2~1 # example
24
- ```
25
-
26
- ### Add commit description
27
-
28
- Please complete your commit description folowing next pattern:
29
-
30
- ```
31
- Technical/Add info files # should be the same name as your branch name
32
-
33
- * Added license, changelog, contributing, code of conduct docs
34
- * Added GitHub templates
35
- * Updated project license link
36
- ```
@@ -1,26 +0,0 @@
1
- # Development environment guide
2
-
3
- ## Preparing
4
-
5
- Clone `smtp_mock` repository:
6
-
7
- ```bash
8
- git clone https://github.com/mocktools/ruby-smtp-mock.git
9
- cd ruby-smtp-mock
10
- ```
11
-
12
- Configure latest Ruby environment:
13
-
14
- ```bash
15
- echo 'ruby-3.1.2' > .ruby-version
16
- cp .circleci/gemspec_latest smtp_mock.gemspec
17
- ```
18
-
19
- ## Commiting
20
-
21
- Commit your changes excluding `.ruby-version`, `smtp_mock.gemspec`
22
-
23
- ```bash
24
- git add . ':!.ruby-version' ':!smtp_mock.gemspec'
25
- git commit -m 'Your new awesome smtp_mock feature'
26
- ```
data/.github/FUNDING.yml DELETED
@@ -1 +0,0 @@
1
- github: [bestwebua]
@@ -1,28 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
- title: "[BUG] Your bug report title here"
5
- labels: bug
6
- assignees: bestwebua
7
-
8
- ---
9
-
10
- <!-- Thanks for helping to make SmtpMock better! Before submit your bug, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->
11
-
12
- ### New bug checklist
13
-
14
- - [ ] I have updated `dns_mock` to the latest version
15
- - [ ] I have read the [Contribution Guidelines](https://github.com/mocktools/ruby-smtp-mock/blob/master/CONTRIBUTING.md)
16
- - [ ] I have read the [documentation](https://github.com/mocktools/ruby-smtp-mock/blob/master/README.md)
17
- - [ ] I have searched for [existing GitHub issues](https://github.com/mocktools/ruby-smtp-mock/issues)
18
-
19
- <!-- Please use next pattern for your bug report title: [BUG] Your bug report title here -->
20
-
21
- ### Bug description
22
- <!-- Please include what's happening, expected behavior, and any relevant code samples -->
23
-
24
- ##### Complete output when running dns_mock, including the stack trace and command used
25
-
26
- <details>
27
- <pre>[INSERT OUTPUT HERE]</pre>
28
- </details>
@@ -1,27 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for SmtpMock
4
- title: "[FEATURE] Your feature request title here"
5
- labels: enhancement
6
- assignees: bestwebua
7
-
8
- ---
9
-
10
- <!-- Thanks for helping to make SmtpMock better! Before submit your new feature request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->
11
-
12
- ### New feature request checklist
13
-
14
- - [ ] I have updated `dns_mock` to the latest version
15
- - [ ] I have read the [Contribution Guidelines](https://github.com/mocktools/ruby-smtp-mock/blob/master/CONTRIBUTING.md)
16
- - [ ] I have read the [documentation](https://github.com/mocktools/ruby-smtp-mock/blob/master/README.md)
17
- - [ ] I have searched for [existing GitHub issues](https://github.com/mocktools/ruby-smtp-mock/issues)
18
-
19
- <!-- Please use next pattern for your feature request title: [FEATURE] Your feature request title here -->
20
-
21
- ### Feature description
22
-
23
- <!-- Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
24
-
25
- Describe the solution you'd like. A clear and concise description of what you want to happen.
26
-
27
- Describe alternatives you've considered. A clear and concise description of any alternative solutions or features you've considered. -->
@@ -1,28 +0,0 @@
1
- ---
2
- name: Issue report
3
- about: Create a report to help us improve
4
- title: "[ISSUE] Your issue report title here"
5
- labels: ''
6
- assignees: bestwebua
7
-
8
- ---
9
-
10
- <!-- Thanks for helping to make SmtpMock better! Before submit your issue, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->
11
-
12
- ### New issue checklist
13
-
14
- - [ ] I have updated `dns_mock` to the latest version
15
- - [ ] I have read the [Contribution Guidelines](https://github.com/mocktools/ruby-smtp-mock/blob/master/CONTRIBUTING.md)
16
- - [ ] I have read the [documentation](https://github.com/mocktools/ruby-smtp-mock/blob/master/README.md)
17
- - [ ] I have searched for [existing GitHub issues](https://github.com/mocktools/ruby-smtp-mock/issues)
18
-
19
- <!-- Please use next pattern for your issue report title: [ISSUE] Your issue report title here -->
20
-
21
- ### Issue description
22
- <!-- Please include what's happening, expected behavior, and any relevant code samples -->
23
-
24
- ##### Complete output when running dns_mock, including the stack trace and command used
25
-
26
- <details>
27
- <pre>[INSERT OUTPUT HERE]</pre>
28
- </details>
@@ -1,22 +0,0 @@
1
- ---
2
- name: Question
3
- about: Ask your question to SmtpMock team
4
- title: "[QUESTION] Your question title here"
5
- labels: question
6
- assignees: bestwebua
7
-
8
- ---
9
-
10
- <!-- Thanks for helping to make SmtpMock better! Before submit your question, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->
11
-
12
- ### New question checklist
13
-
14
- - [ ] I have read the [Contribution Guidelines](https://github.com/mocktools/ruby-smtp-mock/blob/master/CONTRIBUTING.md)
15
- - [ ] I have read the [documentation](https://github.com/mocktools/ruby-smtp-mock/blob/master/README.md)
16
- - [ ] I have searched for [existing GitHub issues](https://github.com/mocktools/ruby-smtp-mock/issues)
17
-
18
- <!-- Please use next pattern for your question title: [QUESTION] Your question title here -->
19
-
20
- ### Question
21
-
22
- <!-- Your question context here -->
@@ -1,49 +0,0 @@
1
- # PR Details
2
-
3
- <!-- Provide a general summary of your changes in the Title above -->
4
- <!-- PR name should the same name as your branch name, example: -->
5
- <!-- Branch name is: feature/add-some-feature -->
6
- <!-- PR name should be: Feature/Add some feature -->
7
-
8
- ## Description
9
-
10
- <!--- Describe your changes in detail -->
11
-
12
- ## Related Issue
13
-
14
- <!--- This project only accepts pull requests related to open issues -->
15
- <!--- If suggesting a new feature or change, please discuss it in an issue first -->
16
- <!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
17
- <!--- Please link to the issue here: -->
18
-
19
- ## Motivation and Context
20
-
21
- <!--- Why is this change required? What problem does it solve? -->
22
-
23
- ## How Has This Been Tested
24
-
25
- <!--- Please describe in detail how you tested your changes. -->
26
- <!--- Include details of your testing environment, and the tests you ran to -->
27
- <!--- see how your change affects other areas of the code, etc. -->
28
-
29
- ## Types of changes
30
-
31
- <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
32
-
33
- - [ ] Docs change / refactoring / dependency upgrade
34
- - [ ] Bug fix (non-breaking change which fixes an issue)
35
- - [ ] New feature (non-breaking change which adds functionality)
36
- - [ ] Breaking change (fix or feature that would cause existing functionality to change)
37
-
38
- ## Checklist
39
-
40
- <!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
41
- <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
42
-
43
- - [ ] My code follows the code style of this project
44
- - [ ] My change requires a change to the documentation
45
- - [ ] I have updated the documentation accordingly
46
- - [ ] I have read the [**CONTRIBUTING** document](https://github.com/mocktools/ruby-smtp-mock/blob/master/CONTRIBUTING.md)
47
- - [ ] I have added tests to cover my changes
48
- - [ ] I have run `bundle exec rspec` from the root directory to see all new and existing tests pass
49
- - [ ] I have run `rubocop` and `reek` to ensure the code style is valid
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/err_log
9
- /bin/smtpmock
10
- .rspec_status
11
- .DS_Store
12
- Gemfile.lock
data/.overcommit.yml DELETED
@@ -1,32 +0,0 @@
1
- PreCommit:
2
- AuthorEmail:
3
- enabled: true
4
- required: false
5
-
6
- AuthorName:
7
- enabled: false
8
-
9
- BundleAudit:
10
- enabled: true
11
-
12
- Fasterer:
13
- enabled: true
14
- include: '**/*.rb'
15
-
16
- TrailingWhitespace:
17
- enabled: true
18
-
19
- RuboCop:
20
- enabled: true
21
- flags: ['--format=emacs', '--force-exclusion', '--display-cop-names']
22
-
23
- Reek:
24
- enabled: true
25
- flags: ['--force-exclusion']
26
-
27
- PostCheckout:
28
- ALL:
29
- quiet: true
30
-
31
- IndexTags:
32
- enabled: true
data/.reek.yml DELETED
@@ -1,31 +0,0 @@
1
- detectors:
2
- IrresponsibleModule:
3
- enabled: false
4
-
5
- UtilityFunction:
6
- exclude:
7
- - SmtpMock::CommandLineArgsBuilder#to_camel_case
8
- - SmtpMock::DependencyHelper#compose_command
9
- - SmtpMock::ServerHelper
10
- - SmtpMock::TestFramework::RSpec::Helper#smtp_mock_server
11
- - SmtpMock::ContextGeneratorHelper#random_message
12
- - SmtpMock::Cli::Resolver#install_to
13
-
14
- NestedIterators:
15
- exclude:
16
- - SmtpMock::CommandLineArgsBuilder#define_attribute
17
-
18
- TooManyStatements:
19
- exclude:
20
- - SmtpMock::Server#run
21
- - SmtpMock::ServerHelper#create_fake_servers
22
- - SmtpMock::Cli::Resolver#install
23
- - SmtpMock::Cli::Resolver#resolve
24
-
25
- TooManyInstanceVariables:
26
- exclude:
27
- - SmtpMock::Server
28
-
29
- LongParameterList:
30
- exclude:
31
- - SmtpMock::ClientHelper#smtp_request
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --require spec_helper
2
- --format documentation
3
- --color
data/.rubocop.yml DELETED
@@ -1,123 +0,0 @@
1
- require:
2
- - rubocop-rspec
3
- - rubocop-performance
4
-
5
- AllCops:
6
- DisplayCopNames: true
7
- DisplayStyleGuide: true
8
- TargetRubyVersion: 2.5
9
- NewCops: enable
10
-
11
- # Metrics ---------------------------------------------------------------------
12
-
13
- Metrics/ClassLength:
14
- Max: 150
15
-
16
- Metrics/MethodLength:
17
- Max: 15
18
-
19
- Metrics/BlockLength:
20
- Enabled: false
21
-
22
- Metrics/CyclomaticComplexity:
23
- Enabled: false
24
-
25
- Metrics/PerceivedComplexity:
26
- Enabled: false
27
-
28
- # Naming ----------------------------------------------------------------------
29
-
30
- Naming/VariableNumber:
31
- Enabled: false
32
-
33
- Naming/RescuedExceptionsVariableName:
34
- Enabled: false
35
-
36
- Naming/InclusiveLanguage:
37
- Enabled: false
38
-
39
- # Style -----------------------------------------------------------------------
40
-
41
- Style/Documentation:
42
- Enabled: false
43
-
44
- Style/DoubleNegation:
45
- Enabled: false
46
-
47
- Style/EmptyCaseCondition:
48
- Enabled: false
49
-
50
- Style/ParallelAssignment:
51
- Enabled: false
52
-
53
- Style/RescueStandardError:
54
- Enabled: false
55
-
56
- # Layout ----------------------------------------------------------------------
57
-
58
- Layout/LineLength:
59
- Max: 150
60
-
61
- Layout/ClassStructure:
62
- Enabled: true
63
- Categories:
64
- module_inclusion:
65
- - include
66
- - prepend
67
- - extend
68
- ExpectedOrder:
69
- - module_inclusion
70
- - constants
71
- - public_class_methods
72
- - initializer
73
- - public_methods
74
- - protected_methods
75
- - private_methods
76
-
77
- Layout/EmptyLineAfterGuardClause:
78
- Enabled: false
79
-
80
- # Gemspec ---------------------------------------------------------------------
81
-
82
- Gemspec/RequireMFA:
83
- Enabled: false
84
-
85
- # Performance -----------------------------------------------------------------
86
-
87
- Performance/MethodObjectAsBlock:
88
- Enabled: false
89
-
90
- # RSpec -----------------------------------------------------------------------
91
-
92
- RSpec/ExampleLength:
93
- Enabled: false
94
-
95
- RSpec/NestedGroups:
96
- Enabled: false
97
-
98
- RSpec/MultipleExpectations:
99
- Enabled: false
100
-
101
- RSpec/MessageChain:
102
- Enabled: false
103
-
104
- RSpec/ContextWording:
105
- Enabled: false
106
-
107
- RSpec/AnyInstance:
108
- Enabled: false
109
-
110
- RSpec/MessageSpies:
111
- Enabled: false
112
-
113
- RSpec/MultipleDescribes:
114
- Enabled: false
115
-
116
- RSpec/MultipleMemoizedHelpers:
117
- Enabled: false
118
-
119
- RSpec/StubbedMock:
120
- Enabled: false
121
-
122
- RSpec/VerifiedDoubleReference:
123
- Enabled: false
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- smtp_mock
data/CHANGELOG.md DELETED
@@ -1,118 +0,0 @@
1
- # Changelog
2
-
3
- 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).
4
-
5
- ## [1.3.0] - 2022-11-19
6
-
7
- ### Added
8
-
9
- - Added ability to configure multiple `RCPT TO` receiving scenario
10
-
11
- ### Updated
12
-
13
- - Updated `SmtpMock::Types::Bool`, tests
14
- - Updated codeclimate/circleci configs
15
- - Updated gemspecs
16
- - Updated gem runtime/development dependencies
17
- - Updated gem documentation, version
18
-
19
- ## [1.2.2] - 2022-10-05
20
-
21
- ### Fixed
22
-
23
- - Fixed wrong semantic version comparison in `SmtpMock::Dependency#minimal_version?`
24
-
25
- ### Updated
26
-
27
- - Updated gemspecs
28
- - Updated tests
29
- - Updated codeclimate/circleci configs
30
- - Updated gem development dependencies
31
- - Updated gem version
32
-
33
- ## [1.2.1] - 2022-07-27
34
-
35
- ### Fixed
36
-
37
- - Fixed documentation
38
-
39
- ### Updated
40
-
41
- - Updated gem documentation, version
42
-
43
- ## [1.2.0] - 2022-07-27
44
-
45
- ### Added
46
-
47
- - Added ability to use `RSET` SMTP command
48
- - Added ability to configure multiple message receiving flow during one session
49
- - Added ability to configure SMTP command delay responses
50
-
51
- ### Updated
52
-
53
- - Updated gemspecs
54
- - Updated tests
55
- - Updated rubocop/codeclimate/circleci configs
56
- - Updated gem development dependencies
57
- - Updated gem documentation, version
58
-
59
- ## [1.1.0] - 2022-05-17
60
-
61
- ### Added
62
-
63
- - Ability to check `smtpmock` version from cli
64
-
65
- ### Updated
66
-
67
- - Updated gemspecs
68
- - Updated codeclimate/circleci configs
69
- - Updated gem development dependencies
70
- - Updated gem version
71
-
72
- ## [1.0.1] - 2022-03-10
73
-
74
- ### Added
75
-
76
- - Development environment guide
77
-
78
- ### Updated
79
-
80
- - Updated gemspecs
81
- - Updated codeclimate/circleci configs
82
- - Updated gem development dependencies
83
- - Updated gem version
84
-
85
- ## [1.0.0] - 2022-01-31
86
-
87
- ### Added
88
-
89
- - Added `smtpmock` version checker
90
- - Added command for upgrade `smtpmock` to latest version
91
- - Added `SmtpMock::Error::Dependency::SMTPMOCK_MIN_VERSION`
92
- - Added `SmtpMock::Server#version`, tests
93
-
94
- ### Updated
95
-
96
- - Updated `SmtpMock::Dependency.verify_dependencies`, tests
97
- - Updated `SmtpMock::Cli::Command`, tests
98
- - Updated gem version, documentation
99
-
100
- ## [0.1.2] - 2022-01-24
101
-
102
- ### Updated
103
-
104
- - Updated `SmtpMock::Cli::Command`, tests
105
- - Updated gem version, documentation
106
-
107
- ## [0.1.1] - 2022-01-18
108
-
109
- ### Updated
110
-
111
- - Updated gem documentation
112
- - Updated codeclimate config
113
-
114
- ## [0.1.0] - 2022-01-18
115
-
116
- ### Added
117
-
118
- - First release of `SmtpMock`. Thanks [@le0pard](https://github.com/le0pard) for support 🚀
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at admin@bestweb.com.ua. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/CONTRIBUTING.md DELETED
@@ -1,48 +0,0 @@
1
- # Contributing to SmtpMock
2
-
3
- Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
4
-
5
- Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
6
-
7
- ## Using the issue tracker
8
-
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
-
11
- ## Issue/bug reports
12
-
13
- A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!
14
-
15
- Guidelines for issue/bug reports:
16
-
17
- 1. **Use the GitHub issue search** &mdash; check if the issue has already been reported
18
- 2. **Check if the issue has been fixed** &mdash; try to reproduce it using the latest `master` or `develop` branch in the repository
19
- 3. SmtpMock [issue template](.github/ISSUE_TEMPLATE/issue_report.md)/[bug template](.github/ISSUE_TEMPLATE/bug_report.md)
20
-
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.
22
-
23
- ## Feature requests
24
-
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.
26
-
27
- ## Questions
28
-
29
- We're always open to a new conversations. So if you have any questions just ask us.
30
-
31
- ## Pull requests
32
-
33
- Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
34
-
35
- **Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code, porting to a different language), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
36
-
37
- Please adhere to the coding conventions used throughout a project (indentation, accurate comments, etc.) and any other requirements (such as test coverage). Not all features proposed will be added but we are open to having a conversation about a feature you are championing.
38
-
39
- Guidelines for pull requests:
40
-
41
- 1. SmtpMock [pull request template](.github/PULL_REQUEST_TEMPLATE.md)
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
46
- 6. Read our [setup development environment guide](.github/DEVELOPMENT_ENVIRONMENT_GUIDE.md)
47
- 7. Make your changes. Please note that your PR should include tests for the new codebase!
48
- 9. Push to your fork and submit a pull request to `develop` branch
data/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
5
- gemspec
data/README.md DELETED
@@ -1,262 +0,0 @@
1
- # ![Ruby SmtpMock - mimic any 📤 SMTP server behaviour for your test environment with fake SMTP server](https://repository-images.githubusercontent.com/443795043/81ce5b00-0915-4dd0-93ad-88e6699e18cd)
2
-
3
- [![Maintainability](https://api.codeclimate.com/v1/badges/315c5fff7449a11868dd/maintainability)](https://codeclimate.com/github/mocktools/ruby-smtp-mock/maintainability)
4
- [![Test Coverage](https://api.codeclimate.com/v1/badges/315c5fff7449a11868dd/test_coverage)](https://codeclimate.com/github/mocktools/ruby-smtp-mock/test_coverage)
5
- [![CircleCI](https://circleci.com/gh/mocktools/ruby-smtp-mock/tree/master.svg?style=svg)](https://circleci.com/gh/mocktools/ruby-smtp-mock/tree/master)
6
- [![Gem Version](https://badge.fury.io/rb/smtp_mock.svg)](https://badge.fury.io/rb/smtp_mock)
7
- [![Downloads](https://img.shields.io/gem/dt/smtp_mock.svg?colorA=004d99&colorB=0073e6)](https://rubygems.org/gems/smtp_mock)
8
- [![In Awesome Ruby](https://raw.githubusercontent.com/sindresorhus/awesome/main/media/mentioned-badge.svg)](https://github.com/markets/awesome-ruby)
9
- [![GitHub](https://img.shields.io/github/license/mocktools/ruby-smtp-mock)](LICENSE.txt)
10
- [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
11
-
12
- 💎 Ruby SMTP mock - flexible Ruby wrapper over [`smtpmock`](https://github.com/mocktools/go-smtp-mock). Mimic any 📤 SMTP server behaviour for your test environment and even more.
13
-
14
- ## Table of Contents
15
-
16
- - [Features](#features)
17
- - [Requirements](#requirements)
18
- - [Installation](#installation)
19
- - [Usage](#usage)
20
- - [Dependency manager](#dependency-manager)
21
- - [Available flags](#available-flags)
22
- - [DSL](#dsl)
23
- - [Available server options](#available-server-options)
24
- - [Example of usage](#example-of-usage)
25
- - [RSpec integration](#rspec-integration)
26
- - [SmtpMock RSpec helper](#smtpmock-rspec-helper)
27
- - [SmtpMock RSpec interface](#smtpmock-rspec-interface)
28
- - [Contributing](#contributing)
29
- - [License](#license)
30
- - [Code of Conduct](#code-of-conduct)
31
- - [Credits](#credits)
32
- - [Versioning](#versioning)
33
- - [Changelog](CHANGELOG.md)
34
-
35
- ## Features
36
-
37
- - Ability to handle configurable behaviour and life cycles of SMTP mock server(s)
38
- - Dynamic/manual port assignment
39
- - Test framework agnostic (it's PORO, so you can use it outside of `RSpec`, `Test::Unit` or `MiniTest`)
40
- - Simple and intuitive DSL
41
- - RSpec integration out of the box
42
- - Includes easy system dependency manager
43
-
44
- ## Requirements
45
-
46
- Ruby MRI 2.5.0+
47
-
48
- ## Installation
49
-
50
- Add this line to your application's `Gemfile`:
51
-
52
- ```ruby
53
- group :development, :test do
54
- gem 'smtp_mock', require: false
55
- end
56
- ```
57
-
58
- And then execute:
59
-
60
- $ bundle
61
-
62
- Or install it yourself as:
63
-
64
- $ gem install smtp_mock
65
-
66
- Then install [`smtpmock`](https://github.com/mocktools/go-smtp-mock) as system dependency:
67
-
68
- $ bundle exec smtp_mock -i ~
69
-
70
- ## Usage
71
-
72
- ### Dependency manager
73
-
74
- This gem includes easy system dependency manager. Run `bundle exec smtp_mock` with options for manage `smtpmock` system dependency.
75
-
76
- #### Available flags
77
-
78
- | Flag | Description | Example of usage |
79
- | --- | --- | --- |
80
- | `-s`, `--sudo` | Run command as sudo | `bundle exec smtp_mock -s -i ~` |
81
- | `-i`, `--install=PATH` | Install `smtpmock` to the existing path | `bundle exec smtp_mock -i ~/existent_dir` |
82
- | `-u`, `--uninstall` | Uninstall `smtpmock` | `bundle exec smtp_mock -u` |
83
- | `-g`, `--upgrade` | Upgrade to latest version of `smtpmock` | `bundle exec smtp_mock -g` |
84
- | `-v`, `--version` | Prints current version of `smtpmock` | `bundle exec smtp_mock -v` |
85
- | `-h`, `--help` | Prints help | `bundle exec smtp_mock -h` |
86
-
87
- ### DSL
88
-
89
- #### Available server options
90
-
91
- | Example of usage kwarg | Description |
92
- | --- | --- |
93
- | `host: '0.0.0.0'` | Host address where smtpmock will run. It's equal to 127.0.0.1 by default |
94
- | `port: 2525` | Server port number. If not specified it will be assigned dynamically |
95
- | `log: true` | Enables log server activity. Disabled by default |
96
- | `session_timeout: 60` | Session timeout in seconds. It's equal to 30 seconds by default |
97
- | `shutdown_timeout: 5` | Graceful shutdown timeout in seconds. It's equal to 1 second by default |
98
- | `fail_fast: true` | Enables fail fast scenario. Disabled by default |
99
- | `multiple_rcptto: true` | Enables multiple `RCPT TO` receiving scenario. Disabled by default |
100
- | `multiple_message_receiving: true` | Enables multiple message receiving scenario. Disabled by default |
101
- | `blacklisted_helo_domains: %w[a.com b.com]` | Blacklisted `HELO` domains |
102
- | `blacklisted_mailfrom_emails: %w[a@a.com b@b.com]` | Blacklisted `MAIL FROM` emails |
103
- | `blacklisted_rcptto_emails: %w[c@c.com d@d.com]` | blacklisted `RCPT TO` emails |
104
- | `not_registered_emails: %w[e@e.com f@f.com]` | Not registered (non-existent) `RCPT TO` emails |
105
- | `response_delay_helo: 2` | `HELO` response delay in seconds. It's equal to 0 seconds by default |
106
- | `response_delay_mailfrom: 2` | `MAIL FROM` response delay in seconds. It's equal to 0 seconds by default |
107
- | `response_delay_rcptto: 2` | `RCPT TO` response delay in seconds. It's equal to 0 seconds by default |
108
- | `response_delay_data: 2` | `DATA` response delay in seconds. It's equal to 0 seconds by default |
109
- | `response_delay_message: 2` | Message response delay in seconds. It's equal to 0 seconds by default |
110
- | `response_delay_rset: 2` | `RSET` response delay in seconds. It's equal to 0 seconds by default |
111
- | `response_delay_quit: 2` | `QUIT` response delay in seconds. It's equal to 0 seconds by default |
112
- | `msg_size_limit: 42` | Message body size limit in bytes. It's equal to 10485760 bytes by default |
113
- | `msg_greeting: 'Greeting message'` | Custom server greeting message |
114
- | `msg_invalid_cmd: 'Invalid command message'` | Custom invalid command message |
115
- | `msg_invalid_cmd_helo_sequence: 'Invalid command HELO sequence message'` | Custom invalid command `HELO` sequence message |
116
- | `msg_invalid_cmd_helo_arg: 'Invalid command HELO argument message'` | Custom invalid command `HELO` argument message |
117
- | `msg_helo_blacklisted_domain: 'Blacklisted domain message'` | Custom `HELO` blacklisted domain message |
118
- | `msg_helo_received: 'HELO received message'` | Custom `HELO` received message |
119
- | `msg_invalid_cmd_mailfrom_sequence: 'Invalid command MAIL FROM sequence message'` | Custom invalid command `MAIL FROM` sequence message |
120
- | `msg_invalid_cmd_mailfrom_arg: 'Invalid command MAIL FROM argument message'` | Custom invalid command `MAIL FROM` argument message |
121
- | `msg_mailfrom_blacklisted_email: 'Blacklisted email message'` | Custom `MAIL FROM` blacklisted email message |
122
- | `msg_mailfrom_received: 'MAIL FROM received message'` | Custom `MAIL FROM` received message |
123
- | `msg_invalid_cmd_rcptto_sequence: 'Invalid command RCPT TO sequence message'` | Custom invalid command `RCPT TO` sequence message |
124
- | `msg_invalid_cmd_rcptto_arg: 'Invalid command RCPT TO argument message'` | Custom invalid command `RCPT TO` argument message |
125
- | `msg_rcptto_not_registered_email: 'Not registered email message'` | Custom `RCPT TO` not registered email message |
126
- | `msg_rcptto_blacklisted_email: 'Blacklisted email message'` | Custom `RCPT TO` blacklisted email message |
127
- | `msg_rcptto_received: 'RCPT TO received message'` | Custom `RCPT TO` received message |
128
- | `msg_invalid_cmd_data_sequence: 'Invalid command DATA sequence message'` | Custom invalid command `DATA` sequence message |
129
- | `msg_data_received: 'DATA received message'` | Custom `DATA` received message |
130
- | `msg_msg_size_is_too_big: 'Message size is too big'` | Custom size is too big message |
131
- | `msg_invalid_cmd_rset_sequence: 'Invalid command RSET sequence message'` | Custom invalid command `RSET` sequence message |
132
- | `msg_invalid_cmd_rset_arg: 'Invalid command RSET argument message'` | Custom invalid command `RSET` argument message |
133
- | `msg_rset_received: 'RSET received message'` | Custom `RSET` received message |
134
- | `msg_quit_cmd: 'Quit command message'` | Custom quit command message |
135
-
136
- #### Example of usage
137
-
138
- ```ruby
139
- # Public SmtpMock interface
140
- # Without kwargs creates SMTP mock server with default behaviour.
141
- # A free port for server will be randomly assigned in the range
142
- # from 49152 to 65535. Returns current smtp mock server instance
143
- smtp_mock_server = SmtpMock.start_server(not_registered_emails: %w[user@example.com]) # => SmtpMock::Server instance
144
-
145
- # returns current smtp mock server port
146
- smtp_mock_server.port # => 55640
147
-
148
- # returns current smtp mock server port
149
- smtp_mock_server.pid # => 38195
150
-
151
- # returns current smtp mock server version
152
- smtp_mock_server.version # => '1.5.2'
153
-
154
- # interface for graceful shutdown current smtp mock server
155
- smtp_mock_server.stop # => true
156
-
157
- # interface for force shutdown current smtp mock server
158
- smtp_mock_server.stop! # => true
159
-
160
- # interface to check state of current smtp mock server
161
- # returns true if server is running, otherwise returns false
162
- smtp_mock_server.active? # => true
163
-
164
- # returns list of running smtp mock servers
165
- SmtpMock.running_servers # => [SmtpMock::Server instance]
166
-
167
- # interface to stop all running smtp mock servers
168
- SmtpMock.stop_running_servers! # => true
169
- ```
170
-
171
- ### RSpec integration
172
-
173
- Require this either in your Gemfile or in RSpec's support scripts. So either:
174
-
175
- ```ruby
176
- # Gemfile
177
-
178
- group :test do
179
- gem 'rspec'
180
- gem 'smtp_mock', require: 'smtp_mock/test_framework/rspec'
181
- end
182
- ```
183
-
184
- or
185
-
186
- ```ruby
187
- # spec/support/config/smtp_mock.rb
188
-
189
- require 'smtp_mock/test_framework/rspec'
190
- ```
191
-
192
- #### SmtpMock RSpec helper
193
-
194
- Just add `SmtpMock::TestFramework::RSpec::Helper` if you wanna use shortcut `smtp_mock_server` for SmtpMock server instance inside of your `RSpec.describe` blocks:
195
-
196
- ```ruby
197
- # spec/support/config/smtp_mock.rb
198
-
199
- RSpec.configure do |config|
200
- config.include SmtpMock::TestFramework::RSpec::Helper
201
- end
202
- ```
203
-
204
- ```ruby
205
- # your awesome smtp_client_spec.rb
206
-
207
- RSpec.describe SmtpClient do
208
- subject(:smtp_response) do
209
- described_class.call(
210
- host: 'localhost',
211
- port: smtp_mock_server.port,
212
- mailfrom: mailfrom,
213
- rcptto: rcptto,
214
- message: message
215
- )
216
- end
217
-
218
- let(:mailfrom) { 'sender@example.com' }
219
- let(:rcptto) { 'receiver@example.com' }
220
- let(:message) { 'Email message context' }
221
- let(:expected_response_message) { '250 Custom successful response' }
222
-
223
- before { smtp_mock_server(msg_msg_received: expected_response_message) }
224
-
225
- it do
226
- expect(smtp_response).to be_success
227
- expect(smtp_response).to have_status(expected_response_status)
228
- expect(smtp_response).to have_message_context(expected_response_message)
229
- end
230
- end
231
- ```
232
-
233
- #### SmtpMock RSpec interface
234
-
235
- If you won't use `SmtpMock::TestFramework::RSpec::Helper` you can use `SmtpMock::TestFramework::RSpec::Interface` directly instead:
236
-
237
- ```ruby
238
- SmtpMock::TestFramework::RSpec::Interface.start_server # creates and runs SmtpMock server instance
239
- SmtpMock::TestFramework::RSpec::Interface.stop_server! # stops and clears current SmtpMock server instance
240
- SmtpMock::TestFramework::RSpec::Interface.clear_server! # clears current SmtpMock server instance
241
- ```
242
-
243
- ## Contributing
244
-
245
- Bug reports and pull requests are welcome on GitHub at https://github.com/mocktools/ruby-smtp-mock. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. Please check the [open tickets](https://github.com/mocktools/ruby-smtp-mock/issues). Be sure to follow Contributor Code of Conduct below and our [Contributing Guidelines](CONTRIBUTING.md).
246
-
247
- ## License
248
-
249
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
250
-
251
- ## Code of Conduct
252
-
253
- Everyone interacting in the SmtpMock project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
254
-
255
- ## Credits
256
-
257
- - [The Contributors](https://github.com/mocktools/ruby-smtp-mock/graphs/contributors) for code and awesome suggestions
258
- - [The Stargazers](https://github.com/mocktools/ruby-smtp-mock/stargazers) for showing their support
259
-
260
- ## Versioning
261
-
262
- SmtpMock uses [Semantic Versioning 2.0.0](https://semver.org)
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec