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


37
38
39
40
41
42
# File 'lib/kitchen/diagnostic.rb', line 37

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

Instance Method Details

#readHash

Returns a Hash with stringified keys containing diagnostic information.

Returns:

  • (Hash)

    a configuration Hash


47
48
49
50
51
52
53
54
# File 'lib/kitchen/diagnostic.rb', line 47

def read
  prepare_common
  prepare_plugins
  prepare_loader
  prepare_instances

  Util.stringified_hash(result)
end