Module: Truemail::RSpec::AuditorHelper

Included in:
Truemail::RSpec
Defined in:
lib/truemail/rspec/auditor_helper.rb

Instance Method Summary collapse

Instance Method Details

#create_auditor(success: true, current_host_ip: ::FFaker::Internet.ip_v4_address, warnings: { ip: Truemail::Audit::Ip::IPIFY_ERROR }, configuration: create_configuration) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/truemail/rspec/auditor_helper.rb', line 6

def create_auditor(
  success: true,
  current_host_ip: ::FFaker::Internet.ip_v4_address,
  warnings: { ip: Truemail::Audit::Ip::IPIFY_ERROR },
  configuration: create_configuration
)
  Truemail::Auditor.new(configuration: configuration).tap do |auditor|
    auditor_result = auditor.result
    auditor_result.current_host_ip = current_host_ip if success
    auditor_result.warnings = warnings unless success
  end
end