Class: Kitchen::Command::Test

Inherits:
Base
  • Object
show all
Includes:
RunAction
Defined in:
lib/kitchen/command/test.rb

Overview

Command to test one or more instances.

Author:

Instance Method Summary collapse

Methods included from RunAction

#concurrency_setting, #report_errors, #run_action, #run_action_in_thread

Methods inherited from Base

#initialize

Methods included from Logging

#banner, #debug, #error, #fatal, #info, #warn

Constructor Details

This class inherits a constructor from Kitchen::Command::Base

Instance Method Details

#callObject

Invoke the command.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/kitchen/command/test.rb', line 31

def call
  unless %w{passing always never}.include?(options[:destroy])
    raise ArgumentError, "Destroy mode must be passing, always, or never."
  end

  banner "Starting Test Kitchen (v#{Kitchen::VERSION})"
  elapsed = Benchmark.measure do
    destroy_mode = options[:destroy].to_sym
    results = parse_subcommand(args.join("|"))

    run_action(:test, results, destroy_mode)
  end
  banner "Test Kitchen is finished. #{Util.duration(elapsed.real)}"
end