Skip to content

Commit 30ddb66

Browse files
authored
Technical/Update gem development dependencies (#267)
* Refactored gem codebase * Updated gem development dependencies * Updated CircleCI config * Updated codeclimate/reek configs
1 parent e36c009 commit 30ddb66

File tree

7 files changed

+11
-14
lines changed

7 files changed

+11
-14
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ 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:
1414
bundle_install: &bundle_install

.circleci/gemspecs/latest

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Gem::Specification.new do |spec|
2828
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
2929
spec.add_development_dependency 'reek', '~> 6.1', '>= 6.1.4'
3030
spec.add_development_dependency 'rspec', '~> 3.12'
31-
spec.add_development_dependency 'rubocop', '~> 1.54', '>= 1.54.2'
32-
spec.add_development_dependency 'rubocop-performance', '~> 1.18'
33-
spec.add_development_dependency 'rubocop-rspec', '~> 2.22'
31+
spec.add_development_dependency 'rubocop', '~> 1.56'
32+
spec.add_development_dependency 'rubocop-performance', '~> 1.19'
33+
spec.add_development_dependency 'rubocop-rspec', '~> 2.23', '>= 2.23.2'
3434
spec.add_development_dependency 'simplecov', '~> 0.22.0'
3535
spec.add_development_dependency 'smtp_mock', '~> 1.3', '>= 1.3.4'
3636
spec.add_development_dependency 'truemail-rspec', '~> 1.1'

.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-54
12+
channel: rubocop-1-56
1313
config:
1414
file: .circleci/linter_configs/.rubocop.yml
1515

.reek.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ detectors:
1313
exclude:
1414
- Truemail::Validate::Smtp::Request#run
1515
- Truemail::Validate::Smtp#run
16+
- Truemail::Validate::Smtp#not_includes_user_not_found_errors?
1617
- Truemail::Validate::Mx#hosts_from_cname_records
1718
- Truemail::Configuration#logger=
1819
- Truemail::Validate::Smtp::Request#initialize

lib/truemail/validate/smtp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def success_response?
6363

6464
def not_includes_user_not_found_errors?
6565
return false unless configuration.smtp_safe_check
66-
result.smtp_debug.map(&:response).map(&:errors).all? do |errors|
66+
result.smtp_debug.map { |request| request.response.errors }.all? do |errors|
6767
next true unless errors.key?(:rcptto)
6868
errors.slice(:rcptto).values.none? do |error|
6969
configuration.smtp_error_body_pattern.match?(error)

spec/truemail/validate/list_match_spec.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@
7373

7474
context 'when email exists on both lists' do
7575
specify do
76-
allow(configuration_instance).to receive(:whitelisted_emails).and_return([email])
77-
allow(configuration_instance).to receive(:blacklisted_emails).and_return([email])
76+
allow(configuration_instance).to receive_messages(whitelisted_emails: [email], blacklisted_emails: [email])
7877
expect { domain_list_match_validator }
7978
.to change(result_instance, :success)
8079
.from(nil).to(true)
@@ -84,8 +83,7 @@
8483

8584
context 'when email domain exists on both lists' do
8685
specify do
87-
allow(configuration_instance).to receive(:whitelisted_domains).and_return([domain])
88-
allow(configuration_instance).to receive(:blacklisted_domains).and_return([domain])
86+
allow(configuration_instance).to receive_messages(whitelisted_domains: [domain], blacklisted_domains: [domain])
8987
expect { domain_list_match_validator }
9088
.to change(result_instance, :success)
9189
.from(nil).to(true)
@@ -96,8 +94,7 @@
9694

9795
context 'when email domain exists not on both lists' do
9896
specify do
99-
allow(configuration_instance).to receive(:whitelisted_domains).and_return([])
100-
allow(configuration_instance).to receive(:blacklisted_domains).and_return([])
97+
allow(configuration_instance).to receive_messages(whitelisted_domains: [], blacklisted_domains: [])
10198
expect { domain_list_match_validator }
10299
.to not_change(result_instance, :success)
103100
.and change(result_instance, :domain)

spec/truemail/validate/smtp/request_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@
272272

273273
it 'rcptto smtp server error' do
274274
allow(session).to receive(:start).with(verifier_domain).and_yield(session)
275-
allow(session).to receive(:helo).and_return(true)
276-
allow(session).to receive(:mailfrom).and_return(true)
275+
allow(session).to receive_messages(helo: true, mailfrom: true)
277276
allow(session).to receive(:rcptto).and_raise(::StandardError, error_message)
278277

279278
expect { response_instance_target_method }

0 commit comments

Comments
 (0)