Sha256: e1253f62248f60e6b99fb329b3d2036ab7e2b5e16141ef8244e30961ed4aeebe

Contents?: true

Size: 618 Bytes

Versions: 1

Compression:

Stored size: 618 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] = FFaker::Internet.email unless configuration_settings[:verifier_email]
        Truemail::Configuration.new(&configuration_block(**configuration_settings))
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
truemail-rspec-0.2.1 lib/truemail/rspec/configuration_helper.rb