diff --git a/.circleci/config.yml b/.circleci/config.yml index 2b8babe..a154bfa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,14 +3,19 @@ version: 2.1 defaults: &defaults working_directory: ~/truemail docker: - - image: circleci/ruby:2.5.0-node + - image: cimg/ruby:<< parameters.ruby-version >> environment: CC_TEST_REPORTER_ID: 693272a1328521f6f7c09d7ffd419b21c00410da26e98e94c687fdd38b26e2cb orbs: - ruby: circleci/ruby@1.1.2 + ruby: circleci/ruby@1.1.3 references: + install_bundler: &install_bundler + run: + name: Installing Bundler + command: gem i bundler -v $(tail -1 Gemfile.lock | tr -d ' ') + restore_bundle_cache: &restore_bundle_cache restore_cache: keys: @@ -29,63 +34,71 @@ references: install_codeclimate_reporter: &install_codeclimate_reporter run: - name: Install Code Climate Test Reporter + name: Installing CodeClimate test reporter command: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter jobs: - linters: + linters-ruby: + parameters: + ruby-version: + type: string + <<: *defaults steps: - checkout + - <<: *install_bundler - <<: *restore_bundle_cache - <<: *bundle_install - <<: *save_bundle_cache - run: - name: Running overcommit + name: Running Overcommit command: | bundle exec overcommit -s SKIP=AuthorEmail,AuthorName bundle exec overcommit -r - tests: + tests-ruby: + parameters: + ruby-version: + type: string + <<: *defaults steps: - checkout + - <<: *install_bundler - <<: *restore_bundle_cache - <<: *bundle_install - <<: *save_bundle_cache - <<: *install_codeclimate_reporter - run: - name: Running tests + name: Running RSpec command: | - mkdir /tmp/test-results ./cc-test-reporter before-build bundle exec rspec - run: - name: Code Climate Test Coverage + name: Creating CodeClimate test coverage report command: | ./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json" - - store_test_results: - path: /tmp/test-results - - store_artifacts: - path: /tmp/test-results - destination: test-results + name: Saving Simplecov coverage artifacts + path: ~/truemail/coverage + destination: coverage - deploy: + name: Uploading CodeClimate test coverage report command: | ./cc-test-reporter sum-coverage --output - --parts $CIRCLE_NODE_TOTAL coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage --debug --input - - compatibility-with-ruby: + compatibility-ruby: parameters: ruby-version: type: string @@ -94,7 +107,6 @@ jobs: steps: - checkout - ruby/install-deps: - bundler-version: '1.16.6' with-cache: false path: './vendor/custom_bundle' - run: @@ -104,9 +116,15 @@ jobs: workflows: build_and_test: jobs: - - linters - - tests - - compatibility-with-ruby: + - linters-ruby: + matrix: + parameters: + ruby-version: ["2.5"] + - tests-ruby: + matrix: + parameters: + ruby-version: ["2.5"] + - compatibility-ruby: matrix: parameters: ruby-version: ["2.6", "2.7", "3.0"] diff --git a/CHANGELOG.md b/CHANGELOG.md index 438e69e..97a9da6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ 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). +## [2.4.2] - 2021.05.13 + +### Fixed + +- Fixed security vulnerability for bundler ([CVE-2019-3881](https://github.com/advisories/GHSA-g98m-96g9-wfjq)) +- Fixed test coverage issues + +### Updated + +- Updated gem development dependencies +- Updated simplecov/CircleCi config +- Updated gem documentation, version + ## [2.4.1] - 2021.05.05 ### Updated diff --git a/Gemfile.lock b/Gemfile.lock index 4aee80d..1e4cde5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - truemail (2.4.1) + truemail (2.4.2) simpleidn (~> 0.2.1) GEM @@ -21,8 +21,8 @@ GEM crack (0.4.5) rexml diff-lcs (1.4.4) - dns_mock (1.2.1) - docile (1.3.5) + dns_mock (1.2.3) + docile (1.4.0) faker (2.17.0) i18n (>= 1.6, < 2) fasterer (0.9.0) @@ -85,7 +85,7 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.5.0) parser (>= 3.0.1.1) - rubocop-performance (1.11.2) + rubocop-performance (1.11.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rspec (2.3.0) @@ -103,10 +103,10 @@ GEM simpleidn (0.2.1) unf (~> 0.1.4) thor (1.1.0) - truemail-rspec (0.5.0) + truemail-rspec (0.6.0) faker (~> 2.17) rspec (~> 3.10) - truemail (>= 2.3) + truemail (>= 2.4) unf (0.1.4) unf_ext unf_ext (0.0.7.7) @@ -117,12 +117,12 @@ GEM hashdiff (>= 0.4.0, < 2.0.0) PLATFORMS - ruby + x86_64-darwin-19 DEPENDENCIES - bundler (~> 1.16) + bundler (~> 2.2, >= 2.2.17) bundler-audit (~> 0.8.0) - dns_mock (~> 1.2, >= 1.2.1) + dns_mock (~> 1.2, >= 1.2.3) faker (~> 2.17) fasterer (~> 0.9.0) json_matchers (~> 0.11.1) @@ -132,12 +132,12 @@ DEPENDENCIES reek (~> 6.0, >= 6.0.4) rspec (~> 3.10) rubocop (~> 1.14) - rubocop-performance (~> 1.11, >= 1.11.2) + rubocop-performance (~> 1.11, >= 1.11.3) rubocop-rspec (~> 2.3) simplecov (~> 0.17.1) truemail! - truemail-rspec (~> 0.5) + truemail-rspec (~> 0.6) webmock (~> 3.12, >= 3.12.2) BUNDLED WITH - 1.16.6 + 2.2.17 diff --git a/README.md b/README.md index 7364540..c0aede1 100644 --- a/README.md +++ b/README.md @@ -178,11 +178,12 @@ Truemail.configure do |config| # Optional parameter. You can predefine default validation type for # Truemail.validate('email@email.com') call without with-parameter - # Available validation types: :regex, :mx, :smtp + # Available validation types: :regex, :mx, :mx_blacklist, :smtp config.default_validation_type = :mx # Optional parameter. You can predefine which type of validation will be used for domains. - # Also you can skip validation by domain. Available validation types: :regex, :mx, :smtp + # Also you can skip validation by domain. + # Available validation types: :regex, :mx, :mx_blacklist, :smtp # This configuration will be used over current or default validation type parameter # All of validations for 'somedomain.com' will be processed with regex validation only. # And all of validations for 'otherdomain.com' will be processed with mx validation only. @@ -222,7 +223,7 @@ Truemail.configure do |config| config.not_rfc_mx_lookup_flow = true # Optional parameter. This option will provide to use smtp fail fast behaviour. When - # smtp_fail_fast = true it means that truemail ends smtp validation session after first + # smtp_fail_fast = true it means that Truemail ends smtp validation session after first # attempt on the first mx server in any fail cases (network connection/timeout error, # smtp validation error). This feature helps to reduce total time of SMTP validation # session up to 1 second. By default this option is disabled. diff --git a/lib/truemail/log/serializer/base.rb b/lib/truemail/log/serializer/base.rb index 89b1267..ebc1221 100644 --- a/lib/truemail/log/serializer/base.rb +++ b/lib/truemail/log/serializer/base.rb @@ -40,20 +40,20 @@ def errors(executor_result_target) Truemail::Log::Serializer::Base::CONFIGURATION_ARRAY_ATTRS.each do |method| define_method(method) do - value = executor_configuration.public_send(method) - return if value.empty? - value + executor_configuration_attr = executor_configuration.public_send(method) + return if executor_configuration_attr.empty? + executor_configuration_attr end end Truemail::Log::Serializer::Base::CONFIGURATION_REGEX_ATTRS.each do |method| define_method(method) do - value = executor_configuration.public_send(method) + executor_configuration_attr = executor_configuration.public_send(method) default_pattern = Truemail::RegexConstant.const_get( (method.eql?(:email_pattern) ? :regex_email_pattern : :regex_smtp_error_body_pattern).upcase ) - return Truemail::Log::Serializer::Base::DEFAULT_GEM_VALUE if value.eql?(default_pattern) - value + return Truemail::Log::Serializer::Base::DEFAULT_GEM_VALUE if executor_configuration_attr.eql?(default_pattern) + executor_configuration_attr end end diff --git a/lib/truemail/version.rb b/lib/truemail/version.rb index 8eb2d41..7cca255 100644 --- a/lib/truemail/version.rb +++ b/lib/truemail/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Truemail - VERSION = '2.4.1' + VERSION = '2.4.2' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5011b5e..9f1af6c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'bundler/setup' +require_relative 'support/config/simplecov' require_relative '../lib/truemail' rspec_custom = ::File.join(::File.dirname(__FILE__), 'support/**/*.rb') diff --git a/spec/support/config/simplecov.rb b/spec/support/config/simplecov.rb index fb7c231..a78b1e6 100644 --- a/spec/support/config/simplecov.rb +++ b/spec/support/config/simplecov.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true -require 'simplecov' +if ::RUBY_VERSION[/\A2\.5.+\z/] + require 'simplecov' -SimpleCov.start + SimpleCov.minimum_coverage(100) + SimpleCov.start { add_filter(%r{\A/spec/}) } +end diff --git a/spec/support/schemas/validator.json b/spec/support/schemas/validator.json index 7732d87..8f1d922 100644 --- a/spec/support/schemas/validator.json +++ b/spec/support/schemas/validator.json @@ -109,6 +109,16 @@ "target host(s) not found" ] }, + "mx_blacklist": { + "$id": "#/properties/errors/properties/mx_blacklist", + "type": "string", + "title": "The mx_blacklist schema", + "description": "An explanation about the purpose of this instance.", + "default": "", + "examples": [ + "blacklisted mx server ip address" + ] + }, "smtp": { "$id": "#/properties/errors/properties/smtp", "type": "string", diff --git a/spec/truemail/audit/dns_spec.rb b/spec/truemail/audit/dns_spec.rb index 13e475b..765d3f3 100644 --- a/spec/truemail/audit/dns_spec.rb +++ b/spec/truemail/audit/dns_spec.rb @@ -3,7 +3,8 @@ RSpec.describe Truemail::Audit::Dns do let(:configuration_instance) { create_configuration(dns: ["127.0.0.1:#{dns_mock_server.port}"]) } let(:verifier_domain) { configuration_instance.verifier_domain } - let(:result_instance) { Truemail::Auditor::Result.new(configuration: configuration_instance) } + let(:current_host_ip) { random_ip_address } + let(:result_instance) { create_auditor(current_host_ip: current_host_ip, configuration: configuration_instance).result } describe 'defined constants' do specify { expect(described_class).to be_const_defined(:VERIFIER_DOMAIN_NOT_REFER) } @@ -30,12 +31,8 @@ let(:dns_auditor_instance) { described_class.new(result_instance) } - before { allow(dns_auditor_instance).to receive(:current_host_ip).and_return(current_host_ip) } - describe 'Success' do context 'when a record found and refers to current host ip' do - let(:current_host_ip) { random_ip_address } - before { dns_mock_server.assign_mocks(verifier_domain => { a: [current_host_ip] }) } it 'not changes warnings' do @@ -46,8 +43,6 @@ end describe 'Fails' do - let(:current_host_ip) { random_ip_address } - shared_examples 'addes verifier domain not refer warning to result instance' do it 'addes verifier domain not refer warning to result instance' do expect { dns_auditor } diff --git a/spec/truemail/audit/ip_spec.rb b/spec/truemail/audit/ip_spec.rb index 9be57eb..7a55e5f 100644 --- a/spec/truemail/audit/ip_spec.rb +++ b/spec/truemail/audit/ip_spec.rb @@ -1,8 +1,7 @@ # frozen_string_literal: true RSpec.describe Truemail::Audit::Ip do - let(:configuration_instance) { create_configuration } - let(:result_instance) { Truemail::Auditor::Result.new(configuration: configuration_instance) } + let(:result_instance) { create_auditor(success: nil, warnings: {}).result } describe 'defined constants' do specify { expect(described_class).to be_const_defined(:GET_MY_IP_URL) } @@ -79,7 +78,7 @@ end context 'if network error' do - let(:expectation) { expect(ip_auditor_instance).to receive(:detect_ip_via_ipify).and_raise(IPAddr::InvalidAddressError) } + let(:expectation) { expect(ip_auditor_instance).to receive(:detect_ip_via_ipify).and_raise(::IPAddr::InvalidAddressError) } include_examples 'addes ipify warning to result instance' end diff --git a/spec/truemail/audit/ptr_spec.rb b/spec/truemail/audit/ptr_spec.rb index c345060..b3f36b7 100644 --- a/spec/truemail/audit/ptr_spec.rb +++ b/spec/truemail/audit/ptr_spec.rb @@ -3,7 +3,8 @@ RSpec.describe Truemail::Audit::Ptr do let(:configuration_instance) { create_configuration(dns: ["127.0.0.1:#{dns_mock_server.port}"]) } let(:verifier_domain) { configuration_instance.verifier_domain } - let(:result_instance) { Truemail::Auditor::Result.new(configuration: configuration_instance) } + let(:current_host_ip) { random_ip_address } + let(:result_instance) { create_auditor(current_host_ip: current_host_ip, configuration: configuration_instance).result } describe 'defined constants' do specify { expect(described_class).to be_const_defined(:PTR_NOT_FOUND) } @@ -30,9 +31,6 @@ subject(:ptr_auditor) { ptr_auditor_instance.run } let(:ptr_auditor_instance) { described_class.new(result_instance) } - let(:current_host_ip) { random_ip_address } - - before { allow(ptr_auditor_instance).to receive(:current_host_ip).and_return(current_host_ip) } describe 'Success' do context 'when ptr record exists and refereces to verifier domain' do diff --git a/spec/truemail/core_spec.rb b/spec/truemail/core_spec.rb index 3d8a7af..e940a92 100644 --- a/spec/truemail/core_spec.rb +++ b/spec/truemail/core_spec.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true RSpec.describe Truemail::ConfigurationError do - specify { expect(described_class).to be < StandardError } + specify { expect(described_class).to be < ::StandardError } end RSpec.describe Truemail::ArgumentError do subject(:argument_error_instance) { described_class.new('arg_value', 'arg_name') } - specify { expect(described_class).to be < StandardError } + specify { expect(described_class).to be < ::StandardError } specify { expect(argument_error_instance).to be_an_instance_of(described_class) } specify { expect(argument_error_instance.to_s).to eq('arg_value is not a valid arg_name') } end diff --git a/spec/truemail/log/serializer/validator_json_spec.rb b/spec/truemail/log/serializer/validator_json_spec.rb index 768c64b..8ba4d19 100644 --- a/spec/truemail/log/serializer/validator_json_spec.rb +++ b/spec/truemail/log/serializer/validator_json_spec.rb @@ -8,21 +8,45 @@ describe '.call' do subject(:json_serializer) { described_class.call(validator_instance) } + let(:default_configuration_instance) { create_configuration } + let(:custom_configuration_instance) do + create_configuration( + email_pattern: /\A.+@.+\z/, + validation_type_for: { random_uniq_domain_name => :regex }, + whitelisted_domains: [random_uniq_domain_name], + blacklisted_domains: [random_uniq_domain_name], + blacklisted_mx_ip_addresses: create_servers_list, + dns: create_servers_list + ) + end + let(:validator_instance) do create_validator( validation_type, success: success_status, - configuration: create_configuration(validation_type_for: { 'somedomain.com' => :regex }) + configuration: configuration_instance ) end shared_context 'serialized json' do - %i[whitelist regex mx smtp].each do |validation_layer_name| + %i[whitelist regex mx mx_blacklist smtp].each do |validation_layer_name| describe "#{validation_layer_name} validation" do let(:validation_type) { validation_layer_name } - it 'returns serialized json' do - expect(json_serializer).to match_json_schema('validator') + context 'with default configuration' do + let(:configuration_instance) { default_configuration_instance } + + it 'returns serialized json' do + expect(json_serializer).to match_json_schema('validator') + end + end + + context 'with custom configuration' do + let(:configuration_instance) { custom_configuration_instance } + + it 'returns serialized json' do + expect(json_serializer).to match_json_schema('validator') + end end end end @@ -53,7 +77,7 @@ end it 'replaces all invalid chars' do - encoded_utf8_string = JSON.parse(json_serializer)['smtp_debug'].first.dig('errors', 'rcptto') + encoded_utf8_string = ::JSON.parse(json_serializer)['smtp_debug'].first.dig('errors', 'rcptto') expect(encoded_utf8_string.size).to eq(3) expect(encoded_utf8_string).to eq("\uFFFDä²»\uFFFD") end diff --git a/spec/truemail/log/serializer/validator_text_spec.rb b/spec/truemail/log/serializer/validator_text_spec.rb index 84bee6c..e6cdbaa 100644 --- a/spec/truemail/log/serializer/validator_text_spec.rb +++ b/spec/truemail/log/serializer/validator_text_spec.rb @@ -73,7 +73,7 @@ include_examples 'formatted text output' end - describe 'ip list match validation' do + describe 'mx blacklist validation' do let(:validation_type) { :mx_blacklist } include_examples 'formatted text output' @@ -136,7 +136,7 @@ include_examples 'formatted text output' end - describe 'ip list match validation' do + describe 'mx blacklist validation' do let(:configuration_instance) { create_configuration(blacklisted_mx_ip_addresses: mx_servers) } let(:validation_type) { :mx_blacklist } let(:error) { 'mx blacklist: blacklisted mx server ip address' } diff --git a/spec/truemail/validate/regex_spec.rb b/spec/truemail/validate/regex_spec.rb index 14e258a..6862be1 100644 --- a/spec/truemail/validate/regex_spec.rb +++ b/spec/truemail/validate/regex_spec.rb @@ -18,23 +18,14 @@ end context 'when validation pass' do - before do - allow(configuration_instance).to receive_message_chain(:email_pattern, :match?).and_return(true) - end - - specify do - expect { regex_validator }.to change(result_instance, :success).from(nil).to(true) - end + before { allow(configuration_instance).to receive_message_chain(:email_pattern, :match?).and_return(true) } - it 'returns true' do - expect(regex_validator).to be(true) - end + specify { expect { regex_validator }.to change(result_instance, :success).from(nil).to(true) } + specify { expect(regex_validator).to be(true) } end context 'when validation fails' do - before do - allow(configuration_instance).to receive_message_chain(:email_pattern, :match?).and_return(false) - end + before { allow(configuration_instance).to receive_message_chain(:email_pattern, :match?).and_return(false) } specify do expect { regex_validator } @@ -44,9 +35,7 @@ .from({}).to(regex: Truemail::Validate::Regex::ERROR) end - it 'returns false' do - expect(regex_validator).to be(false) - end + specify { expect(regex_validator).to be(false) } end end end diff --git a/spec/truemail/validate/smtp/request_spec.rb b/spec/truemail/validate/smtp/request_spec.rb index 58f26bf..6f41367 100644 --- a/spec/truemail/validate/smtp/request_spec.rb +++ b/spec/truemail/validate/smtp/request_spec.rb @@ -44,7 +44,7 @@ context 'when port opened' do specify do - allow(Socket).to receive(:tcp) + allow(::Socket).to receive(:tcp) .with( mail_server, Truemail::Validate::Smtp::Request::SMTP_PORT, @@ -58,13 +58,13 @@ context 'when port closed' do let(:error_stubs) do - allow(Socket).to receive(:tcp) + allow(::Socket).to receive(:tcp) .with( mail_server, Truemail::Validate::Smtp::Request::SMTP_PORT, connect_timeout: connection_timeout ) - .and_raise(Errno::ETIMEDOUT) + .and_raise(::Errno::ETIMEDOUT) end specify do @@ -81,7 +81,7 @@ let(:session) { request_instance.send(:session) } before do - allow(Net::SMTP) + allow(::Net::SMTP) .to receive(:new) .with(request_instance_host, Truemail::Validate::Smtp::Request::SMTP_PORT) .and_call_original @@ -103,7 +103,7 @@ before do allow(session).to receive(:open_timeout=).with(connection_timeout) allow(session).to receive(:read_timeout=).with(response_timeout) - allow(Net::SMTP) + allow(::Net::SMTP) .to receive(:new) .with(request_instance_host, Truemail::Validate::Smtp::Request::SMTP_PORT) .and_return(session) @@ -149,9 +149,9 @@ ) end - context 'when connection timeout error' do + context 'when open connection timeout error' do let(:error_stubs) do - allow(session).to receive(:start).and_raise(Net::OpenTimeout) + allow(session).to receive(:start).and_raise(::Net::OpenTimeout) end specify do @@ -172,10 +172,33 @@ include_examples 'request retry behavior' end + context 'when read connection timeout error' do + let(:error_stubs) do + allow(session).to receive(:start).and_raise(::Net::ReadTimeout) + end + + specify do + error_stubs + + expect { response_instance_target_method } + .to change(response_instance, :connection) + .from(nil).to(false) + .and change(response_instance, :errors) + .from({}).to(connection: Truemail::Validate::Smtp::Request::RESPONSE_TIMEOUT_ERROR) + .and not_change(response_instance, :helo) + .and not_change(response_instance, :mailfrom) + .and not_change(response_instance, :rcptto) + + expect(response_instance_target_method).to be(false) + end + + include_examples 'request retry behavior' + end + context 'when remote server has dropped connection during session' do let(:error_stubs) do - allow(session).to receive(:start).and_yield(session).and_raise(EOFError) - allow(session).to receive(:mailfrom).and_raise(StandardError) + allow(session).to receive(:start).and_yield(session).and_raise(::EOFError) + allow(session).to receive(:mailfrom).and_raise(::StandardError) end specify do @@ -200,7 +223,7 @@ context 'when connection other errors' do let(:error_stubs) do - allow(session).to receive(:start).and_raise(StandardError, error_message) + allow(session).to receive(:start).and_raise(::StandardError, error_message) end specify do @@ -225,7 +248,7 @@ it 'mailfrom smtp server error' do allow(session).to receive(:start).and_yield(session) allow(session).to receive(:helo).and_return(true) - allow(session).to receive(:mailfrom).and_raise(StandardError, error_message) + allow(session).to receive(:mailfrom).and_raise(::StandardError, error_message) allow(session).to receive(:rcptto) expect { response_instance_target_method } @@ -248,7 +271,7 @@ allow(session).to receive(:start).and_yield(session) allow(session).to receive(:helo).and_return(true) allow(session).to receive(:mailfrom).and_return(true) - allow(session).to receive(:rcptto).and_raise(StandardError, error_message) + allow(session).to receive(:rcptto).and_raise(::StandardError, error_message) expect { response_instance_target_method } .to change(response_instance, :connection) diff --git a/spec/truemail/wrapper_spec.rb b/spec/truemail/wrapper_spec.rb index bbfd022..dbd7f62 100644 --- a/spec/truemail/wrapper_spec.rb +++ b/spec/truemail/wrapper_spec.rb @@ -38,21 +38,21 @@ context 'when raises exception' do context 'with Resolv::ResolvError exception' do specify do - allow(mx_instance).to receive(method).and_raise(Resolv::ResolvError) + allow(mx_instance).to receive(method).and_raise(::Resolv::ResolvError) expect(resolver_execution_wrapper).to be(false) end end context 'with IPAddr::InvalidAddressError exception' do specify do - allow(mx_instance).to receive(method).and_raise(IPAddr::InvalidAddressError) + allow(mx_instance).to receive(method).and_raise(::IPAddr::InvalidAddressError) expect(resolver_execution_wrapper).to be(false) end end context 'with Timeout::Error exception' do specify do - allow(mx_instance).to receive(method).and_raise(Timeout::Error) + allow(mx_instance).to receive(method).and_raise(::Timeout::Error) expect { resolver_execution_wrapper } .to change(resolver_execution_wrapper_instance, :attempts).from(2).to(0) diff --git a/truemail.gemspec b/truemail.gemspec index 3e731de..b84f410 100644 --- a/truemail.gemspec +++ b/truemail.gemspec @@ -33,9 +33,9 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency 'simpleidn', '~> 0.2.1' - spec.add_development_dependency 'bundler', '~> 1.16' + spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.17' spec.add_development_dependency 'bundler-audit', '~> 0.8.0' - spec.add_development_dependency 'dns_mock', '~> 1.2', '>= 1.2.1' + spec.add_development_dependency 'dns_mock', '~> 1.2', '>= 1.2.3' spec.add_development_dependency 'faker', '~> 2.17' spec.add_development_dependency 'fasterer', '~> 0.9.0' spec.add_development_dependency 'json_matchers', '~> 0.11.1' @@ -45,9 +45,9 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.4' spec.add_development_dependency 'rspec', '~> 3.10' spec.add_development_dependency 'rubocop', '~> 1.14' - spec.add_development_dependency 'rubocop-performance', '~> 1.11', '>= 1.11.2' + spec.add_development_dependency 'rubocop-performance', '~> 1.11', '>= 1.11.3' spec.add_development_dependency 'rubocop-rspec', '~> 2.3' spec.add_development_dependency 'simplecov', '~> 0.17.1' - spec.add_development_dependency 'truemail-rspec', '~> 0.5' + spec.add_development_dependency 'truemail-rspec', '~> 0.6' spec.add_development_dependency 'webmock', '~> 3.12', '>= 3.12.2' end