Skip to content

Commit 6306cb9

Browse files
authored
Merge pull request #79 from mocktools/develop
Ruby SmtpMock v1.3.5
2 parents 8aa82ea + bd02b05 commit 6306cb9

26 files changed

Lines changed: 203 additions & 171 deletions

.circleci/config.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,20 @@ defaults: &defaults
88
- image: cimg/ruby:<< parameters.ruby-version >>
99

1010
orbs:
11-
ruby: circleci/ruby@2.0.0
11+
ruby: circleci/ruby@2.1.0
1212

1313
references:
14-
restore_bundle_cache: &restore_bundle_cache
15-
restore_cache:
16-
keys:
17-
- ruby-smtp-mock-{{ checksum "smtp_mock.gemspec" }}
18-
paths:
19-
- ~/vendor/bundle
20-
2114
bundle_install: &bundle_install
2215
run:
2316
name: Installing gems
2417
command: |
2518
bundle config set --local path '~/vendor/bundle'
2619
bundle install
2720
28-
save_bundle_cache: &save_bundle_cache
29-
save_cache:
30-
key: ruby-smtp-mock-{{ checksum "smtp_mock.gemspec" }}
31-
paths:
32-
- ~/vendor/bundle
33-
34-
system_dependencies: &system_dependencies
21+
install_system_dependencies: &install_system_dependencies
3522
run:
36-
name: Installing system requirements
37-
command: |
38-
bundle exec smtp_mock -s -i ~
23+
name: Installing system dependencies
24+
command: bundle exec smtp_mock -s -i ~
3925

4026
install_linters: &install_linters
4127
run:
@@ -55,6 +41,11 @@ references:
5541
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
5642
chmod +x ./cc-test-reporter
5743
44+
use_latest_bundler: &use_latest_bundler
45+
run:
46+
name: Using latest bundler
47+
command: gem install bundler
48+
5849
use_latest_gemspec: &use_latest_gemspec
5950
run:
6051
name: Using latest gemspec
@@ -76,10 +67,9 @@ jobs:
7667
steps:
7768
- checkout
7869

70+
- <<: *use_latest_bundler
7971
- <<: *use_latest_gemspec
80-
- <<: *restore_bundle_cache
8172
- <<: *bundle_install
82-
- <<: *save_bundle_cache
8373
- <<: *install_linters
8474

8575
- run:
@@ -112,11 +102,10 @@ jobs:
112102
steps:
113103
- checkout
114104

105+
- <<: *use_latest_bundler
115106
- <<: *use_latest_gemspec
116-
- <<: *restore_bundle_cache
117107
- <<: *bundle_install
118-
- <<: *save_bundle_cache
119-
- <<: *system_dependencies
108+
- <<: *install_system_dependencies
120109
- <<: *install_codeclimate_reporter
121110

122111
- run:
@@ -157,12 +146,26 @@ jobs:
157146
with-cache: false
158147
path: '~/vendor/custom_bundle'
159148

160-
- <<: *system_dependencies
149+
- <<: *install_system_dependencies
161150

162151
- run:
163152
name: Running compatibility tests
164153
command: bundle exec rspec
165154

155+
rubygems-deps-ruby:
156+
parameters:
157+
ruby-version:
158+
type: string
159+
160+
<<: *defaults
161+
162+
steps:
163+
- checkout
164+
165+
- run:
166+
name: Building rubygems dependencies from default gemspec on minimal Ruby version
167+
command: bundle install
168+
166169
releasing-gem-from-ruby:
167170
parameters:
168171
ruby-version:
@@ -196,11 +199,16 @@ workflows:
196199
matrix:
197200
parameters:
198201
ruby-version: ["2.5", "2.6", "2.7", "3.0", "3.1"]
202+
- rubygems-deps-ruby:
203+
matrix:
204+
parameters:
205+
ruby-version: ["2.5"]
199206
- releasing-gem-from-ruby:
200207
requires:
201208
- linters-ruby
202209
- tests-ruby
203210
- compatibility-ruby
211+
- rubygems-deps-ruby
204212
matrix:
205213
parameters:
206214
ruby-version: ["2.5"]

.circleci/gemspecs/latest

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Gem::Specification.new do |spec|
2020
spec.add_runtime_dependency 'dry-struct', '~> 1.6'
2121

2222
spec.add_development_dependency 'bundler-audit', '~> 0.9.1'
23-
spec.add_development_dependency 'fasterer', '~> 0.10.0'
24-
spec.add_development_dependency 'ffaker', '~> 2.21'
25-
spec.add_development_dependency 'net-smtp', '~> 0.3.3'
23+
spec.add_development_dependency 'fasterer', '~> 0.10.1'
24+
spec.add_development_dependency 'ffaker', '~> 2.23'
25+
spec.add_development_dependency 'net-smtp', '~> 0.4.0'
2626
spec.add_development_dependency 'pry-byebug', '~> 3.10', '>= 3.10.1'
2727
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
28-
spec.add_development_dependency 'reek', '~> 6.1', '>= 6.1.3'
28+
spec.add_development_dependency 'reek', '~> 6.1', '>= 6.1.4'
2929
spec.add_development_dependency 'rspec', '~> 3.12'
30-
spec.add_development_dependency 'rubocop', '~> 1.42'
31-
spec.add_development_dependency 'rubocop-performance', '~> 1.15', '>= 1.15.2'
32-
spec.add_development_dependency 'rubocop-rspec', '~> 2.16'
30+
spec.add_development_dependency 'rubocop', '~> 1.57', '>= 1.57.1'
31+
spec.add_development_dependency 'rubocop-performance', '~> 1.19', '>= 1.19.1'
32+
spec.add_development_dependency 'rubocop-rspec', '~> 2.24', '>= 2.24.1'
3333
spec.add_development_dependency 'simplecov', '~> 0.22.0'
3434
end

.circleci/linter_configs/.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ Layout/EmptyLineAfterGuardClause:
8888
Gemspec/RequireMFA:
8989
Enabled: false
9090

91+
Gemspec/DevelopmentDependencies:
92+
Enabled: false
93+
9194
# Performance -----------------------------------------------------------------
9295

9396
Performance/MethodObjectAsBlock:

.codeclimate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ checks:
99
plugins:
1010
rubocop:
1111
enabled: true
12-
channel: rubocop-1-42
12+
channel: rubocop-1-56
1313
config:
1414
file: .circleci/linter_configs/.rubocop.yml
1515

.reek.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ detectors:
77
UtilityFunction:
88
exclude:
99
- SmtpMock::CommandLineArgsBuilder#to_camel_case
10-
- SmtpMock::DependencyHelper#compose_command
10+
- SmtpMock::Cli::Resolver#install_to
1111
- SmtpMock::ServerHelper
1212
- SmtpMock::TestFramework::RSpec::Helper#smtp_mock_server
13-
- SmtpMock::ContextGeneratorHelper#random_message
14-
- SmtpMock::Cli::Resolver#install_to
13+
- SmtpMock::RspecHelper::ContextGenerator#random_message
14+
- SmtpMock::RspecHelper::Dependency#compose_command
15+
- SmtpMock::RspecHelper::Server#create_fake_servers
16+
- SmtpMock::RspecHelper::Server#reset_err_log
1517

1618
NestedIterators:
1719
exclude:
@@ -20,14 +22,14 @@ detectors:
2022
TooManyStatements:
2123
exclude:
2224
- SmtpMock::Server#run
23-
- SmtpMock::ServerHelper#create_fake_servers
2425
- SmtpMock::Cli::Resolver#install
2526
- SmtpMock::Cli::Resolver#resolve
27+
- SmtpMock::RspecHelper::Server#create_fake_servers
2628

2729
TooManyInstanceVariables:
2830
exclude:
2931
- SmtpMock::Server
3032

3133
LongParameterList:
3234
exclude:
33-
- SmtpMock::ClientHelper#smtp_request
35+
- SmtpMock::RspecHelper::Client#smtp_request

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
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).
44

5+
## [1.3.5] - 2023-10-17
6+
7+
### Updated
8+
9+
- Updated gem development dependencies
10+
- Updated RSpec structure
11+
- Updated linters configs
12+
- Updated gem version
13+
514
## [1.3.4] - 2023-01-11
615

716
### Updated

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at admin@bestweb.com.ua. All
58+
reported by contacting the project team at <admin@bestweb.com.ua>. All
5959
complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.

lib/smtp_mock/cli/resolver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def install_to(install_path)
7373
end
7474

7575
def as_sudo
76-
return 'sudo ' if sudo
76+
'sudo ' if sudo
7777
end
7878

7979
def current_smtpmock_path

lib/smtp_mock/test_framework/rspec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
require 'rspec/core'
44
require_relative '../../smtp_mock'
5-
require_relative './rspec/interface'
6-
require_relative './rspec/helper'
5+
require_relative 'rspec/interface'
6+
require_relative 'rspec/helper'
77

88
RSpec.configure do |config|
99
config.after { SmtpMock::TestFramework::RSpec::Interface.stop_server! }

lib/smtp_mock/test_framework/rspec/helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
require_relative './interface'
3+
require_relative 'interface'
44

55
module SmtpMock
66
module TestFramework

0 commit comments

Comments
 (0)