Class: Kitchen::Terraform::InSpec::WithoutHosts

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/terraform/inspec/without_hosts.rb

Overview

WithoutHosts is the class of objects which execute InSpec without hosts.

Instance Method Summary collapse

Constructor Details

#initialize(options:, profile_locations:) ⇒ Kitchen::Terraform::InSpec::WithoutHosts

#initialize prepares a new instance of the class.

Parameters:

  • options (Hash)

    a mapping of InSpec options.

  • profile_locations (Array<::String>)

    the locations of the InSpec profiles which contain the controls to be executed.



41
42
43
44
# File 'lib/kitchen/terraform/inspec/without_hosts.rb', line 41

def initialize(options:, profile_locations:)
  self.options = options
  self.profile_locations = profile_locations
end

Instance Method Details

#execself

#exec executes the InSpec controls of an InSpec profile.

Returns:

  • (self)

Raises:

  • (Kitchen::TransientFailure)

    if the execution of InSpec fails.



29
30
31
32
33
# File 'lib/kitchen/terraform/inspec/without_hosts.rb', line 29

def exec
  ::Kitchen::Terraform::InSpecRunner.new(options: options, profile_locations: profile_locations).exec

  self
end