File tree Expand file tree Collapse file tree 7 files changed +11
-14
lines changed
Expand file tree Collapse file tree 7 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ defaults: &defaults
88 - image : cimg/ruby:<< parameters.ruby-version >>
99
1010orbs :
11- ruby : circleci/ruby@2.0 .0
11+ ruby : circleci/ruby@2.1 .0
1212
1313references :
1414 bundle_install : &bundle_install
Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff line change 99plugins :
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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change 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 )
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 )
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 )
Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments