Class: Kitchen::Terraform::InSpec::FailFastWithHosts
- Inherits:
-
Object
- Object
- Kitchen::Terraform::InSpec::FailFastWithHosts
- Defined in:
- lib/kitchen/terraform/inspec/fail_fast_with_hosts.rb
Overview
FailFastWithHosts is the class of objects which execute InSpec against multiple hosts and raise rescued errors immediately.
Instance Method Summary collapse
-
#exec ⇒ self
exec executes the InSpec controls of an InSpec profile.
-
#initialize(hosts:, options:, profile_locations:) ⇒ Kitchen::Terraform::InSpec::FailFastWithHosts
constructor
#initialize prepares a new instance of the class.
Constructor Details
#initialize(hosts:, options:, profile_locations:) ⇒ Kitchen::Terraform::InSpec::FailFastWithHosts
#initialize prepares a new instance of the class.
47 48 49 50 51 |
# File 'lib/kitchen/terraform/inspec/fail_fast_with_hosts.rb', line 47 def initialize(hosts:, options:, profile_locations:) self.hosts = hosts self. = self.profile_locations = profile_locations end |
Instance Method Details
#exec ⇒ self
exec executes the InSpec controls of an InSpec profile.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/kitchen/terraform/inspec/fail_fast_with_hosts.rb', line 29 def exec hosts.each do |host| ::Kitchen::Terraform::InSpecRunner.new( options: .merge(host: host), profile_locations: profile_locations, ).exec end self end |