Sha256: 7701010d208d5f147c18a47d9dc41485ae0a9aeaa7814bba2691fecf52c530f4

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

require_relative './actions'
require_relative './parameters'

module RSpec
  module Terraform
    module Helpers
      class Base
        include Parameters
        include Actions

        attr_reader(
          :configuration_provider,
          :binary,
          :logger,
          :stdin,
          :stdout,
          :stderr,
          :execution_mode
        )

        def initialize(opts = {})
          @configuration_provider =
            opts[:configuration_provider] || Configuration.identity_provider
          @binary = opts[:binary] || 'terraform'
          @logger = opts[:logger]
          @stdin = opts[:stdin]
          @stdout = opts[:stdout]
          @stderr = opts[:stderr]
          @execution_mode = opts[:execution_mode] || :in_place
        end

        private

        def mandatory_parameters
          {}
        end

        def required_parameters(_)
          []
        end

        def command_options
          {
            binary: binary,
            logger: logger,
            stdin: stdin,
            stdout: stdout,
            stderr: stderr
          }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-terraform-0.1.0.pre.46 lib/rspec/terraform/helpers/base.rb