Skip to content

Commit

Permalink
Technical/Update gem dependencies (#136)
Browse files Browse the repository at this point in the history
- Updated gem development dependencies
- Updated rubocop/codeclimate config
- Updated tests
- Updated gem version, changelog
  • Loading branch information
bestwebua authored Feb 26, 2021
1 parent edd53c8 commit e55ca16
Show file tree
Hide file tree
Showing 32 changed files with 192 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ checks:
plugins:
rubocop:
enabled: true
channel: rubocop-1-9
channel: rubocop-1-10

reek:
enabled: true
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ Style/EndlessMethod:
Style/IfWithBooleanLiteralBranches:
Enabled: true

Style/HashConversion:
Enabled: true

Layout/LineLength:
Max: 140

Expand Down Expand Up @@ -302,6 +305,9 @@ Lint/SymbolConversion:
Lint/TripleQuotes:
Enabled: true

Gemspec/DateAssignment:
Enabled: true

Performance/AncestorsInclude:
Enabled: true

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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.3.1] - 2020.02.26

### Changed

- Updated gem development dependencies
- Updated rubocop/codeclimate config
- Updated tests

## [2.3.0] - 2020.02.05

### Added
Expand Down
32 changes: 16 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
truemail (2.3.0)
truemail (2.3.1)
simpleidn (~> 0.2.1)

GEM
Expand All @@ -23,13 +23,13 @@ GEM
diff-lcs (1.4.4)
dns_mock (1.2.0)
docile (1.3.5)
faker (2.15.1)
faker (2.16.0)
i18n (>= 1.6, < 2)
fasterer (0.8.3)
fasterer (0.9.0)
colorize (~> 0.7)
ruby_parser (>= 3.14.1)
hashdiff (1.0.1)
i18n (1.8.8)
i18n (1.8.9)
concurrent-ruby (~> 1.0)
iniparse (1.5.0)
json (2.5.1)
Expand All @@ -50,7 +50,7 @@ GEM
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.13.0)
psych (3.3.0)
psych (3.3.1)
public_suffix (4.0.6)
rainbow (3.0.0)
rake (13.0.3)
Expand All @@ -59,7 +59,7 @@ GEM
parser (~> 3.0.0)
psych (~> 3.1)
rainbow (>= 2.0, < 4.0)
regexp_parser (2.0.3)
regexp_parser (2.1.1)
rexml (3.2.4)
rspec (3.10.0)
rspec-core (~> 3.10.0)
Expand All @@ -74,7 +74,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
rubocop (1.9.1)
rubocop (1.10.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
Expand Down Expand Up @@ -103,15 +103,15 @@ GEM
simpleidn (0.2.1)
unf (~> 0.1.4)
thor (1.1.0)
truemail-rspec (0.3.3)
faker (~> 2.15, >= 2.15.1)
truemail-rspec (0.4.0)
faker (~> 2.16)
rspec (~> 3.10)
truemail (~> 2.2)
truemail (>= 2.3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (2.0.0)
webmock (3.11.2)
webmock (3.12.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand All @@ -123,21 +123,21 @@ DEPENDENCIES
bundler (~> 1.16)
bundler-audit (~> 0.7.0.1)
dns_mock (~> 1.2)
faker (~> 2.15, >= 2.15.1)
fasterer (~> 0.8.3)
faker (~> 2.16)
fasterer (~> 0.9.0)
json_matchers (~> 0.11.1)
overcommit (~> 0.57.0)
pry-byebug (~> 3.9)
rake (~> 13.0, >= 13.0.3)
reek (~> 6.0, >= 6.0.3)
rspec (~> 3.10)
rubocop (~> 1.9, >= 1.9.1)
rubocop (~> 1.10)
rubocop-performance (~> 1.9, >= 1.9.2)
rubocop-rspec (~> 2.2)
simplecov (~> 0.17.1)
truemail!
truemail-rspec (~> 0.3.3)
webmock (~> 3.11, >= 3.11.2)
truemail-rspec (~> 0.4)
webmock (~> 3.12)

BUNDLED WITH
1.16.6
13 changes: 3 additions & 10 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
# frozen_string_literal: true

require 'bundler/setup'
require 'truemail'
require 'pry'
require_relative '../lib/truemail'

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

require 'irb'
IRB.start(__FILE__)
Pry.start
2 changes: 1 addition & 1 deletion lib/truemail/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Truemail
VERSION = '2.3.0'
VERSION = '2.3.1'
end
19 changes: 4 additions & 15 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
# frozen_string_literal: true

require 'bundler/setup'
require 'simplecov'
require 'faker'
require 'json_matchers/rspec'
require 'pry'
require 'truemail'
require 'truemail/rspec'
require 'dns_mock/test_framework/rspec'
require 'webmock/rspec'
require_relative '../lib/truemail'

SimpleCov.start
JsonMatchers.schema_root = 'spec/support/schemas'

rspec_custom = File.join(File.dirname(__FILE__), 'support/**/*.rb')
Dir[File.expand_path(rspec_custom)].each { |file| require file unless file[/\A.+_spec\.rb\z/] }
rspec_custom = ::File.join(::File.dirname(__FILE__), 'support/**/*.rb')
::Dir[File.expand_path(rspec_custom)].each { |file| require file unless file[/\A.+_spec\.rb\z/] }

RSpec::Mocks.configuration.allow_message_expectations_on_nil = true
RSpec.configure do |config|
config.include Truemail::RSpec
config.include Truemail::ContextHelper
config.include Truemail::IpifyHelper
config.include DnsMock::TestFramework::RSpec::Helper
config.order = :random
config.example_status_persistence_file_path = '.rspec_status'
config.disable_monkey_patching!
Expand Down
7 changes: 7 additions & 0 deletions spec/support/config/dns_mock.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

require 'dns_mock/test_framework/rspec'

RSpec.configure do |config|
config.include DnsMock::TestFramework::RSpec::Helper
end
3 changes: 3 additions & 0 deletions spec/support/config/faker.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# frozen_string_literal: true

require 'faker'
5 changes: 5 additions & 0 deletions spec/support/config/json_matchers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

require 'json_matchers/rspec'

JsonMatchers.schema_root = 'spec/support/schemas'
3 changes: 3 additions & 0 deletions spec/support/config/pry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# frozen_string_literal: true

require 'pry'
5 changes: 5 additions & 0 deletions spec/support/config/simplecov.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

require 'simplecov'

SimpleCov.start
7 changes: 7 additions & 0 deletions spec/support/config/truemail.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

require 'truemail/rspec'

RSpec.configure do |config|
config.include Truemail::RSpec
end
3 changes: 3 additions & 0 deletions spec/support/config/webmock.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# frozen_string_literal: true

require 'webmock/rspec'
27 changes: 27 additions & 0 deletions spec/support/helpers/context_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

module Truemail
module ContextHelper
def random_email
faker.email
end

def random_ip_address
faker.ip_v4_address
end

def random_domain_name
faker.domain_name
end

def random_uniq_domain_name
faker.unique.domain_name
end

private

def faker
Faker::Internet
end
end
end
33 changes: 33 additions & 0 deletions spec/support/helpers/context_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

RSpec.describe Truemail::ContextHelper, type: :helper do # rubocop:disable RSpec/FilePath
describe '#random_email' do
specify do
expect(Faker::Internet).to receive(:email).and_call_original
expect(random_email).to match(Truemail::RegexConstant::REGEX_EMAIL_PATTERN)
end
end

describe '#random_domain_name' do
specify do
expect(Faker::Internet).to receive(:domain_name).and_call_original
expect(random_domain_name).to match(Truemail::RegexConstant::REGEX_DOMAIN_PATTERN)
end
end

describe '#random_uniq_domain_name' do
specify do
expect(Faker::Internet).to receive_message_chain(:unique, :domain_name)
random_uniq_domain_name
end

specify { expect(random_domain_name).to match(Truemail::RegexConstant::REGEX_DOMAIN_PATTERN) }
end

describe '#random_ip_address' do
specify do
expect(Faker::Internet).to receive(:ip_v4_address).and_call_original
expect(random_ip_address).to match(Truemail::RegexConstant::REGEX_DNS_SERVER_ADDRESS_PATTERN)
end
end
end
2 changes: 1 addition & 1 deletion spec/support/helpers/ipify_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.describe Truemail::IpifyHelper, type: :helper do # rubocop:disable RSpec/FilePath
describe '#mock_ipify_request' do
let(:ip_address) { Faker::Internet.ip_v4_address }
let(:ip_address) { random_ip_address }

specify do
mock_ipify_request(ip_address)
Expand Down
6 changes: 3 additions & 3 deletions spec/truemail/audit/dns_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

describe 'Success' do
context 'when a record found and refers to current host ip' do
let(:current_host_ip) { Faker::Internet.ip_v4_address }
let(:current_host_ip) { random_ip_address }

before { dns_mock_server.assign_mocks(verifier_domain => { a: [current_host_ip] }) }

Expand All @@ -46,7 +46,7 @@
end

describe 'Fails' do
let(:current_host_ip) { Faker::Internet.ip_v4_address }
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
Expand All @@ -62,7 +62,7 @@
end

context 'when a record of verifier domain not refers to currernt host ip address' do
before { dns_mock_server.assign_mocks(verifier_domain => { a: [Faker::Internet.ip_v4_address] }) }
before { dns_mock_server.assign_mocks(verifier_domain => { a: [random_ip_address] }) }

include_examples 'addes verifier domain not refer warning to result instance'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/truemail/audit/ip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

describe 'Success' do
context 'when determination of host ip address was successful' do
let(:host_address) { Faker::Internet.ip_v4_address }
let(:host_address) { random_ip_address }

before { mock_ipify_request(host_address) }

Expand Down
4 changes: 2 additions & 2 deletions spec/truemail/audit/ptr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
subject(:ptr_auditor) { ptr_auditor_instance.run }

let(:ptr_auditor_instance) { described_class.new(result_instance) }
let(:current_host_ip) { Faker::Internet.ip_v4_address }
let(:current_host_ip) { random_ip_address }

before { allow(ptr_auditor_instance).to receive(:current_host_ip).and_return(current_host_ip) }

Expand Down Expand Up @@ -74,7 +74,7 @@
context 'when ptr records do not refer to verifier domain' do
let(:warning_context) { Truemail::Audit::Ptr::PTR_NOT_REFER }

before { dns_mock_server.assign_mocks(current_host_ip => { ptr: [Faker::Internet.domain_name] }) }
before { dns_mock_server.assign_mocks(current_host_ip => { ptr: [random_domain_name] }) }

include_examples 'addes warning context into result instance'
end
Expand Down
Loading

0 comments on commit e55ca16

Please sign in to comment.