Class: Kitchen::Diagnostic

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/diagnostic.rb

Overview

Combines and compiles diagnostic information about a Test Kitchen configuration suitable for support and troubleshooting.

Author:

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Diagnostic

Constructs a new Diagnostic object with an optional loader and optional instances array.

Parameters:

  • options (Hash) (defaults to: {})

    optional configuration

Options Hash (options):

  • :loader (#diagnose, Hash)

    a loader instance that responds to #diagnose or an error Hash

  • :instances (Array<#diagnose>, Hash)

    an Array of instances that respond to #diagnose or an error Hash

  • :plugins (true, false)

    whether or not plugins should be returned



40
41
42
43
44
45
# File 'lib/kitchen/diagnostic.rb', line 40

def initialize(options = {})
  @loader = options.fetch(:loader, nil)
  @instances = options.fetch(:instances, [])
  @plugins = options.fetch(:plugins, false)
  @result = Hash.new
end

Instance Method Details

#readHash

Returns a Hash with stringified keys containing diagnostic information.

Returns:

  • (Hash)

    a configuration Hash



50
51
52
53
54
55
56
57
# File 'lib/kitchen/diagnostic.rb', line 50

def read
  prepare_common
  prepare_plugins
  prepare_loader
  prepare_instances

  Util.stringified_hash(result)
end