Module: Kitchen::Verifier

Defined in:
lib/kitchen/verifier.rb,
lib/kitchen/verifier/base.rb,
lib/kitchen/verifier/dummy.rb,
lib/kitchen/verifier/busser.rb

Overview

A verifier is responsible for running tests post-converge to confirm that the instance is in a known/consistent state.

Author:

Defined Under Namespace

Classes: Base, Busser, Dummy

Constant Summary collapse

DEFAULT_PLUGIN =

Default verifier to use

"busser".freeze

Class Method Summary collapse

Class Method Details

.for_plugin(plugin, config) ⇒ Verifier::Base

Returns an instance of a verifier given a plugin type string.

Parameters:

  • plugin (String)

    a verifier plugin type, to be constantized

  • config (Hash)

    a configuration hash to initialize the verifier

Returns:

Raises:

  • (ClientError)

    if a verifier instance could not be created



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/kitchen/verifier.rb', line 40

def self.for_plugin(plugin, config)
  first_load = require("kitchen/verifier/#{plugin}")

  str_const = Thor::Util.camel_case(plugin)
  klass = const_get(str_const)
  object = klass.new(config)
  object.verify_dependencies if first_load
  object
rescue LoadError, NameError
  raise ClientError,
    "Could not load the '#{plugin}' verifier from the load path." \
      " Please ensure that your transport is installed as a gem or" \
      " included in your Gemfile if using Bundler."
end