Sha256: f2d7fa68f1b35b480e9cc89b1d97afa5e342c4e617e40773140b82e186b0e501

Contents?: true

Size: 619 Bytes

Versions: 5

Compression:

Stored size: 619 Bytes

Contents

# frozen_string_literal: true

module Truemail
  module RSpec
    module ConfigurationHelper
      def configuration_block(**configuration_settings)
        lambda do |config|
          configuration_settings.each do |attribute, value|
            config.public_send(:"#{attribute}=", value)
          end
        end
      end

      def create_configuration(**configuration_settings)
        configuration_settings[:verifier_email] = ::Faker::Internet.email unless configuration_settings[:verifier_email]
        Truemail::Configuration.new(&configuration_block(**configuration_settings))
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
truemail-rspec-0.6.0 lib/truemail/rspec/configuration_helper.rb
truemail-rspec-0.5.0 lib/truemail/rspec/configuration_helper.rb
truemail-rspec-0.4.0 lib/truemail/rspec/configuration_helper.rb
truemail-rspec-0.3.3 lib/truemail/rspec/configuration_helper.rb
truemail-rspec-0.3.2 lib/truemail/rspec/configuration_helper.rb