class Kitchen::Pulumi::InSpecWithoutHosts

InSpec instances act as interfaces to the InSpec gem.

Attributes

options[RW]
profile_locations[RW]

Public Class Methods

new(options:, profile_locations:) click to toggle source

@param options [::Hash] options for execution. @param profile_locations [::Array<::String>] the locations of the

InSpec profiles which contain the controls to be executed.
# File lib/kitchen/pulumi/inspec_without_hosts.rb, line 28
def initialize(options:, profile_locations:)
  self.options = options
  self.profile_locations = profile_locations
end

Public Instance Methods

exec(system:) click to toggle source

exec executes the InSpec controls of an InSpec profile.

@raise [::Kitchen::Pulumi::Error] if the execution of the InSpec

controls fails.

@return [void]

# File lib/kitchen/pulumi/inspec_without_hosts.rb, line 14
def exec(system:)
  ::Kitchen::Pulumi::InSpec
    .new(options: options, profile_locations: profile_locations)
    .info(message: "#{system}: Verifying")
    .exec
end