test-kitchen 1.14.1 → 1.14.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/Berksfile +1 -1
  3. data/CHANGELOG.md +7 -0
  4. data/Gemfile +1 -1
  5. data/Guardfile +5 -5
  6. data/Rakefile +5 -5
  7. data/bin/kitchen +1 -1
  8. data/features/step_definitions/gem_steps.rb +6 -6
  9. data/features/support/env.rb +6 -7
  10. data/lib/kitchen.rb +5 -7
  11. data/lib/kitchen/base64_stream.rb +2 -8
  12. data/lib/kitchen/cli.rb +76 -80
  13. data/lib/kitchen/collection.rb +0 -2
  14. data/lib/kitchen/color.rb +7 -9
  15. data/lib/kitchen/command.rb +0 -4
  16. data/lib/kitchen/command/action.rb +0 -3
  17. data/lib/kitchen/command/console.rb +4 -7
  18. data/lib/kitchen/command/diagnose.rb +7 -14
  19. data/lib/kitchen/command/driver_discover.rb +1 -4
  20. data/lib/kitchen/command/exec.rb +0 -3
  21. data/lib/kitchen/command/list.rb +9 -12
  22. data/lib/kitchen/command/login.rb +0 -3
  23. data/lib/kitchen/command/package.rb +0 -3
  24. data/lib/kitchen/command/sink.rb +6 -9
  25. data/lib/kitchen/command/test.rb +1 -4
  26. data/lib/kitchen/config.rb +25 -27
  27. data/lib/kitchen/configurable.rb +26 -31
  28. data/lib/kitchen/data_munger.rb +34 -36
  29. data/lib/kitchen/diagnostic.rb +5 -7
  30. data/lib/kitchen/driver.rb +3 -5
  31. data/lib/kitchen/driver/base.rb +0 -3
  32. data/lib/kitchen/driver/dummy.rb +0 -3
  33. data/lib/kitchen/driver/proxy.rb +0 -3
  34. data/lib/kitchen/driver/ssh_base.rb +13 -16
  35. data/lib/kitchen/errors.rb +11 -16
  36. data/lib/kitchen/generator/driver_create.rb +18 -21
  37. data/lib/kitchen/generator/init.rb +21 -26
  38. data/lib/kitchen/instance.rb +19 -23
  39. data/lib/kitchen/lazy_hash.rb +1 -2
  40. data/lib/kitchen/loader/yaml.rb +22 -25
  41. data/lib/kitchen/logger.rb +9 -14
  42. data/lib/kitchen/logging.rb +0 -3
  43. data/lib/kitchen/login_command.rb +0 -2
  44. data/lib/kitchen/metadata_chopper.rb +0 -2
  45. data/lib/kitchen/platform.rb +1 -3
  46. data/lib/kitchen/provisioner.rb +3 -5
  47. data/lib/kitchen/provisioner/base.rb +2 -5
  48. data/lib/kitchen/provisioner/chef/berkshelf.rb +1 -5
  49. data/lib/kitchen/provisioner/chef/common_sandbox.rb +24 -29
  50. data/lib/kitchen/provisioner/chef/librarian.rb +2 -6
  51. data/lib/kitchen/provisioner/chef/policyfile.rb +4 -8
  52. data/lib/kitchen/provisioner/chef_apply.rb +14 -17
  53. data/lib/kitchen/provisioner/chef_base.rb +43 -46
  54. data/lib/kitchen/provisioner/chef_solo.rb +10 -13
  55. data/lib/kitchen/provisioner/chef_zero.rb +22 -29
  56. data/lib/kitchen/provisioner/dummy.rb +0 -3
  57. data/lib/kitchen/provisioner/shell.rb +6 -9
  58. data/lib/kitchen/rake_tasks.rb +4 -6
  59. data/lib/kitchen/shell_out.rb +3 -5
  60. data/lib/kitchen/ssh.rb +16 -22
  61. data/lib/kitchen/state_file.rb +3 -5
  62. data/lib/kitchen/suite.rb +0 -2
  63. data/lib/kitchen/thor_tasks.rb +2 -4
  64. data/lib/kitchen/transport.rb +3 -5
  65. data/lib/kitchen/transport/base.rb +1 -7
  66. data/lib/kitchen/transport/dummy.rb +0 -4
  67. data/lib/kitchen/transport/ssh.rb +41 -47
  68. data/lib/kitchen/transport/winrm.rb +41 -40
  69. data/lib/kitchen/util.rb +1 -3
  70. data/lib/kitchen/verifier.rb +3 -5
  71. data/lib/kitchen/verifier/base.rb +2 -5
  72. data/lib/kitchen/verifier/busser.rb +24 -24
  73. data/lib/kitchen/verifier/dummy.rb +0 -3
  74. data/lib/kitchen/verifier/shell.rb +1 -3
  75. data/lib/kitchen/version.rb +1 -1
  76. data/lib/vendor/hash_recursive_merge.rb +0 -2
  77. data/spec/kitchen/base64_stream_spec.rb +3 -6
  78. data/spec/kitchen/cli_spec.rb +0 -2
  79. data/spec/kitchen/collection_spec.rb +4 -8
  80. data/spec/kitchen/color_spec.rb +0 -3
  81. data/spec/kitchen/config_spec.rb +91 -106
  82. data/spec/kitchen/configurable_spec.rb +44 -76
  83. data/spec/kitchen/data_munger_spec.rb +1178 -1247
  84. data/spec/kitchen/diagnostic_spec.rb +37 -38
  85. data/spec/kitchen/driver/base_spec.rb +7 -14
  86. data/spec/kitchen/driver/dummy_spec.rb +1 -7
  87. data/spec/kitchen/driver/proxy_spec.rb +2 -7
  88. data/spec/kitchen/driver/ssh_base_spec.rb +128 -149
  89. data/spec/kitchen/driver_spec.rb +7 -13
  90. data/spec/kitchen/errors_spec.rb +50 -60
  91. data/spec/kitchen/instance_spec.rb +217 -294
  92. data/spec/kitchen/lazy_hash_spec.rb +14 -18
  93. data/spec/kitchen/loader/yaml_spec.rb +201 -227
  94. data/spec/kitchen/logger_spec.rb +7 -15
  95. data/spec/kitchen/logging_spec.rb +1 -4
  96. data/spec/kitchen/login_command_spec.rb +3 -4
  97. data/spec/kitchen/metadata_chopper_spec.rb +0 -3
  98. data/spec/kitchen/platform_spec.rb +31 -32
  99. data/spec/kitchen/provisioner/base_spec.rb +22 -41
  100. data/spec/kitchen/provisioner/chef/policyfile_spec.rb +15 -15
  101. data/spec/kitchen/provisioner/chef_apply_spec.rb +8 -13
  102. data/spec/kitchen/provisioner/chef_base_spec.rb +150 -182
  103. data/spec/kitchen/provisioner/chef_solo_spec.rb +58 -72
  104. data/spec/kitchen/provisioner/chef_zero_spec.rb +99 -125
  105. data/spec/kitchen/provisioner/dummy_spec.rb +8 -11
  106. data/spec/kitchen/provisioner/shell_spec.rb +86 -103
  107. data/spec/kitchen/provisioner_spec.rb +5 -11
  108. data/spec/kitchen/shell_out_spec.rb +15 -19
  109. data/spec/kitchen/ssh_spec.rb +16 -35
  110. data/spec/kitchen/state_file_spec.rb +6 -11
  111. data/spec/kitchen/suite_spec.rb +5 -6
  112. data/spec/kitchen/transport/base_spec.rb +6 -14
  113. data/spec/kitchen/transport/ssh_spec.rb +39 -64
  114. data/spec/kitchen/transport/winrm_spec.rb +99 -127
  115. data/spec/kitchen/transport_spec.rb +7 -13
  116. data/spec/kitchen/util_spec.rb +17 -26
  117. data/spec/kitchen/verifier/base_spec.rb +24 -40
  118. data/spec/kitchen/verifier/busser_spec.rb +38 -68
  119. data/spec/kitchen/verifier/dummy_spec.rb +8 -11
  120. data/spec/kitchen/verifier/shell_spec.rb +14 -17
  121. data/spec/kitchen/verifier_spec.rb +7 -13
  122. data/spec/kitchen_spec.rb +4 -6
  123. data/spec/spec_helper.rb +1 -1
  124. data/spec/support/powershell_max_size_spec.rb +1 -2
  125. data/support/chef-client-zero.rb +3 -4
  126. data/test-kitchen.gemspec +4 -6
  127. metadata +9 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8ccafe4e398360bb727601769ea1ddfed256a55
4
- data.tar.gz: abd5306dc5701626a6acd0e1e2fe58898d528af5
3
+ metadata.gz: 5c05ebc3b72de7bada3043bbc959dfab446719f2
4
+ data.tar.gz: d3f771be84d3b0f462e043f2555f2e7c6650bf8c
5
5
  SHA512:
6
- metadata.gz: a3b4df81176556959785509f27c18b3936e8c32bcc8db7935f1b9ad8bfebae99cebd6d2076275accc0d49ff2553a21059c512efac66c47ae5f213654bff8e3c2
7
- data.tar.gz: 2fc0aecc71a0eb17060c276bbb6f543962db4b9508f1aeeb65dc0e8a932fae786b7814a16369c11b041f45c84db0a3991681cbd9eb22660b3818937925c02e81
6
+ metadata.gz: f22ea5175f699bd9832c55fa728748dcda32b47fa51febb7bc6d5840e6aaa11851279236c0e6abbce7f7975b031a4162e837e5dc0a9a127dc252661c4db0d623
7
+ data.tar.gz: 03babbdee7eea8a7d2e9852b01485dfeeb0ba03ba700993fb75a13c4f72e7bcd18b8bdc73b541ebd57e19be6934366b512c6fc9d85b2888ea1380cb9b38e8d4d
data/Berksfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source "https://supermarket.chef.io"
2
2
 
3
- cookbook "test_cookbook", :path => "./test/cookbooks/test_cookbook"
3
+ cookbook "test_cookbook", path: "./test/cookbooks/test_cookbook"
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## [v1.14.2](https://github.com/test-kitchen/test-kitchen/tree/v1.14.2) (2016-12-09)
4
+ [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.14.1...v1.14.2)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Replace finstyle in favor of chefstyle [\#1166](https://github.com/test-kitchen/test-kitchen/pull/1166) ([afiune](https://github.com/afiune))
9
+
3
10
  ## [v1.14.1](https://github.com/test-kitchen/test-kitchen/tree/v1.14.1) (2016-12-08)
4
11
  [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.14.0...v1.14.1)
5
12
 
data/Gemfile CHANGED
@@ -11,5 +11,5 @@ group :integration do
11
11
  end
12
12
 
13
13
  group :test do
14
- gem "codeclimate-test-reporter", "~> 1.0", ">= 1.0.3", :require => nil
14
+ gem "codeclimate-test-reporter", "~> 1.0", ">= 1.0.3", require: nil
15
15
  end
data/Guardfile CHANGED
@@ -2,21 +2,21 @@
2
2
  ignore %r{^\.gem/}
3
3
 
4
4
  def rubocop_opts
5
- { :all_on_start => false, :keep_failed => false, :cli => "-r finstyle" }
5
+ { all_on_start: false, keep_failed: false, cli: "-r finstyle" }
6
6
  end
7
7
 
8
8
  def cucumber_opts
9
9
  cucumber_cli = "--no-profile --color --format progress --strict"
10
10
  cucumber_cli += " --tags ~@spawn" if RUBY_PLATFORM =~ /mswin|mingw|windows/
11
11
 
12
- { :all_on_start => false, :cli => cucumber_cli }
12
+ { all_on_start: false, cli: cucumber_cli }
13
13
  end
14
14
 
15
15
  def yard_opts
16
- { :port => "8808" }
16
+ { port: "8808" }
17
17
  end
18
18
 
19
- group :red_green_refactor, :halt_on_fail => true do
19
+ group :red_green_refactor, halt_on_fail: true do
20
20
  guard :minitest do
21
21
  watch(%r{^spec/(.*)_spec\.rb})
22
22
  watch(%r{^lib/(.*)([^/]+)\.rb}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
@@ -24,7 +24,7 @@ group :red_green_refactor, :halt_on_fail => true do
24
24
  end
25
25
 
26
26
  guard :rubocop, rubocop_opts do
27
- watch(%r{.+\.rb$})
27
+ watch(/.+\.rb$/)
28
28
  watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
29
29
  end
30
30
  end
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ rescue LoadError
20
20
  end
21
21
 
22
22
  desc "Run all test suites"
23
- task :test => [:unit, :features]
23
+ task test: [:unit, :features]
24
24
 
25
25
  desc "Display LOC stats"
26
26
  task :stats do
@@ -31,7 +31,7 @@ task :stats do
31
31
  end
32
32
 
33
33
  begin
34
- require "finstyle"
34
+ require "chefstyle"
35
35
  require "rubocop/rake_task"
36
36
  RuboCop::RakeTask.new(:style) do |task|
37
37
  task.options += ["--display-cop-names", "--no-color"]
@@ -41,7 +41,7 @@ rescue LoadError
41
41
  end
42
42
 
43
43
  desc "Run all quality tasks"
44
- task :quality => [:style, :stats]
44
+ task quality: [:style, :stats]
45
45
 
46
46
  begin
47
47
  require "yard"
@@ -50,7 +50,7 @@ rescue LoadError
50
50
  puts "yard is not available. (sudo) gem install yard to generate yard documentation."
51
51
  end
52
52
 
53
- task :default => [:test, :quality]
53
+ task default: [:test, :quality]
54
54
 
55
55
  begin
56
56
  require "github_changelog_generator/task"
@@ -60,7 +60,7 @@ begin
60
60
  config.future_release = "v#{Kitchen::VERSION}"
61
61
  config.enhancement_labels = "enhancement,Enhancement,New Feature,Feature,Improvement".split(",")
62
62
  config.bug_labels = "bug,Bug".split(",")
63
- config.exclude_labels = %w[Duplicate Question Discussion No_Changelog]
63
+ config.exclude_labels = %w{Duplicate Question Discussion No_Changelog}
64
64
  end
65
65
  rescue LoadError
66
66
  puts "github_changelog_generator is not available." \
@@ -5,7 +5,7 @@
5
5
  # https://twitter.com/mitchellh/status/283014103189053442
6
6
  Signal.trap("INT") { exit 1 }
7
7
 
8
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), %w[.. lib])
8
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), %w{.. lib})
9
9
  require "rubygems"
10
10
  require "kitchen/cli"
11
11
  require "kitchen/errors"
@@ -19,9 +19,9 @@ Then(/^a gem named "(.*?)" is installed with version "(.*?)"$/) do |name, versio
19
19
  unbundlerize do
20
20
  run_simple(
21
21
  sanitize_text("gem list #{name} --version #{version} -i"),
22
- :fail_on_error => true,
23
- :exit_timeout => nil
24
- )
22
+ fail_on_error: true,
23
+ exit_timeout: nil
24
+ )
25
25
  end
26
26
  end
27
27
 
@@ -29,8 +29,8 @@ Then(/^a gem named "(.*?)" is installed$/) do |name|
29
29
  unbundlerize do
30
30
  run_simple(
31
31
  sanitize_text("gem list #{name} -i"),
32
- :fail_on_error => true,
33
- :exit_timeout => nil
34
- )
32
+ fail_on_error: true,
33
+ exit_timeout: nil
34
+ )
35
35
  end
36
36
  end
@@ -8,7 +8,6 @@ require "kitchen"
8
8
  require "kitchen/cli"
9
9
 
10
10
  class ArubaHelper
11
-
12
11
  def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel)
13
12
  @argv = argv
14
13
  @stdin = stdin
@@ -48,11 +47,11 @@ After do |s|
48
47
  # Restore environment variables to their original settings, if they have
49
48
  # been saved off
50
49
  env = aruba.environment
51
- env.to_h.keys.select { |key| key =~ /^_CUKE_/ }.
52
- each do |backup_key|
53
- env[backup_key.sub(/^_CUKE_/, "")] = env[backup_key]
54
- env.delete(backup_key)
55
- end
50
+ env.to_h.keys.select { |key| key =~ /^_CUKE_/ }
51
+ .each do |backup_key|
52
+ env[backup_key.sub(/^_CUKE_/, "")] = env[backup_key]
53
+ env.delete(backup_key)
54
+ end
56
55
 
57
56
  @cleanup_dirs.each { |dir| FileUtils.rm_rf(dir) }
58
57
  end
@@ -67,7 +66,7 @@ def restore_envvar(key)
67
66
  end
68
67
 
69
68
  def unbundlerize
70
- keys = %w[BUNDLER_EDITOR BUNDLE_BIN_PATH BUNDLE_GEMFILE RUBYOPT]
69
+ keys = %w{BUNDLER_EDITOR BUNDLE_BIN_PATH BUNDLE_GEMFILE RUBYOPT}
71
70
 
72
71
  keys.each { |key| backup_envvar(key); aruba.environment.delete(key) }
73
72
  yield
@@ -53,9 +53,7 @@ require "kitchen/version"
53
53
  #
54
54
  # @author Fletcher Nichol <fnichol@nichol.ca>
55
55
  module Kitchen
56
-
57
56
  class << self
58
-
59
57
  # @return [Logger] the common Kitchen logger
60
58
  attr_accessor :logger
61
59
 
@@ -73,7 +71,7 @@ module Kitchen
73
71
  #
74
72
  # @return [Logger] a logger
75
73
  def default_logger
76
- Logger.new(:stdout => $stdout, :level => Util.to_logger_level(env_log))
74
+ Logger.new(stdout: $stdout, level: Util.to_logger_level(env_log))
77
75
  end
78
76
 
79
77
  # Returns a default file logger which emits on standard output and to a
@@ -89,10 +87,10 @@ module Kitchen
89
87
  log_location = log_location.to_s
90
88
 
91
89
  Logger.new(
92
- :stdout => $stdout,
93
- :logdev => log_location,
94
- :level => Util.to_logger_level(level),
95
- :log_overwrite => log_overwrite
90
+ stdout: $stdout,
91
+ logdev: log_location,
92
+ level: Util.to_logger_level(level),
93
+ log_overwrite: log_overwrite
96
94
  )
97
95
  end
98
96
 
@@ -17,13 +17,11 @@
17
17
  # limitations under the License.
18
18
 
19
19
  module Kitchen
20
-
21
20
  # Base64 encoder/decoder that operates on IO objects so as to minimize
22
21
  # memory allocations on large payloads.
23
22
  #
24
23
  # @author Fletcher Nichol <fnichol@nichol.ca>
25
24
  module Base64Stream
26
-
27
25
  # Encodes an input stream into a Base64 output stream. The input and ouput
28
26
  # objects must be opened IO resources. In other words, opening and closing
29
27
  # the resources are not the responsibilty of this method.
@@ -32,9 +30,7 @@ module Kitchen
32
30
  # @param io_out [#write] output stream
33
31
  def self.strict_encode(io_in, io_out)
34
32
  buffer = ""
35
- while io_in.read(3 * 1000, buffer)
36
- io_out.write([buffer].pack("m0"))
37
- end
33
+ io_out.write([buffer].pack("m0")) while io_in.read(3 * 1000, buffer)
38
34
  buffer = nil # rubocop:disable Lint/UselessAssignment
39
35
  end
40
36
 
@@ -46,9 +42,7 @@ module Kitchen
46
42
  # @param io_out [#write] output stream
47
43
  def self.strict_decode(io_in, io_out)
48
44
  buffer = ""
49
- while io_in.read(3 * 1000, buffer)
50
- io_out.write(buffer.unpack("m0").first)
51
- end
45
+ io_out.write(buffer.unpack("m0").first) while io_in.read(3 * 1000, buffer)
52
46
  buffer = nil # rubocop:disable Lint/UselessAssignment
53
47
  end
54
48
  end
@@ -23,15 +23,12 @@ require "kitchen/generator/driver_create"
23
23
  require "kitchen/generator/init"
24
24
 
25
25
  module Kitchen
26
-
27
26
  # The command line runner for Kitchen.
28
27
  #
29
28
  # @author Fletcher Nichol <fnichol@nichol.ca>
30
29
  class CLI < Thor
31
-
32
30
  # Common module to load and invoke a CLI-implementation agnostic command.
33
31
  module PerformCommand
34
-
35
32
  # Perform a CLI subcommand.
36
33
  #
37
34
  # @param task [String] action to take, usually corresponding to the
@@ -45,10 +42,10 @@ module Kitchen
45
42
  require "kitchen/command/#{command}"
46
43
 
47
44
  command_options = {
48
- :action => task,
49
- :help => -> { help(task) },
50
- :config => @config,
51
- :shell => shell
45
+ action: task,
46
+ help: -> { help(task) },
47
+ config: @config,
48
+ shell: shell,
52
49
  }.merge(additional_options)
53
50
 
54
51
  str_const = Thor::Util.camel_case(command)
@@ -71,12 +68,12 @@ module Kitchen
71
68
  super
72
69
  $stdout.sync = true
73
70
  @loader = Kitchen::Loader::YAML.new(
74
- :project_config => ENV["KITCHEN_YAML"],
75
- :local_config => ENV["KITCHEN_LOCAL_YAML"],
76
- :global_config => ENV["KITCHEN_GLOBAL_YAML"]
71
+ project_config: ENV["KITCHEN_YAML"],
72
+ local_config: ENV["KITCHEN_LOCAL_YAML"],
73
+ global_config: ENV["KITCHEN_GLOBAL_YAML"]
77
74
  )
78
75
  @config = Kitchen::Config.new(
79
- :loader => @loader
76
+ loader: @loader
80
77
  )
81
78
  @config.log_level = Kitchen.env_log unless Kitchen.env_log.nil?
82
79
  @config.log_overwrite = Kitchen.env_log_overwrite unless Kitchen.env_log_overwrite.nil?
@@ -86,78 +83,78 @@ module Kitchen
86
83
  # @api private
87
84
  def self.log_options
88
85
  method_option :log_level,
89
- :aliases => "-l",
90
- :desc => "Set the log level (debug, info, warn, error, fatal)"
86
+ aliases: "-l",
87
+ desc: "Set the log level (debug, info, warn, error, fatal)"
91
88
  method_option :log_overwrite,
92
- :desc => "Set to false to prevent log overwriting each time Test Kitchen runs",
93
- :type => :boolean
89
+ desc: "Set to false to prevent log overwriting each time Test Kitchen runs",
90
+ type: :boolean
94
91
  method_option :color,
95
- :type => :boolean,
96
- :lazy_default => $stdout.tty?,
97
- :desc => "Toggle color output for STDOUT logger"
92
+ type: :boolean,
93
+ lazy_default: $stdout.tty?,
94
+ desc: "Toggle color output for STDOUT logger"
98
95
  end
99
96
 
100
97
  # Sets the test_base_path method_options
101
98
  # @api private
102
99
  def self.test_base_path
103
100
  method_option :test_base_path,
104
- :aliases => "-t",
105
- :desc => "Set the base path of the tests"
101
+ aliases: "-t",
102
+ desc: "Set the base path of the tests"
106
103
  end
107
104
 
108
105
  desc "list [INSTANCE|REGEXP|all]", "Lists one or more instances"
109
106
  method_option :bare,
110
- :aliases => "-b",
111
- :type => :boolean,
112
- :desc => "List the name of each instance only, one per line"
107
+ aliases: "-b",
108
+ type: :boolean,
109
+ desc: "List the name of each instance only, one per line"
113
110
  method_option :json,
114
- :aliases => "-j",
115
- :type => :boolean,
116
- :desc => "Print data as JSON"
111
+ aliases: "-j",
112
+ type: :boolean,
113
+ desc: "Print data as JSON"
117
114
  method_option :debug,
118
- :aliases => "-d",
119
- :type => :boolean,
120
- :desc => "[Deprecated] Please use `kitchen diagnose'"
115
+ aliases: "-d",
116
+ type: :boolean,
117
+ desc: "[Deprecated] Please use `kitchen diagnose'"
121
118
  log_options
122
119
  def list(*args)
123
120
  update_config!
124
121
  perform("list", "list", args)
125
122
  end
126
- map :status => :list
123
+ map status: :list
127
124
 
128
125
  desc "diagnose [INSTANCE|REGEXP|all]", "Show computed diagnostic configuration"
129
126
  method_option :loader,
130
- :type => :boolean,
131
- :desc => "Include data loader diagnostics"
127
+ type: :boolean,
128
+ desc: "Include data loader diagnostics"
132
129
  method_option :plugins,
133
- :type => :boolean,
134
- :desc => "Include plugin diagnostics"
130
+ type: :boolean,
131
+ desc: "Include plugin diagnostics"
135
132
  method_option :instances,
136
- :type => :boolean,
137
- :default => true,
138
- :desc => "Include instances diagnostics"
133
+ type: :boolean,
134
+ default: true,
135
+ desc: "Include instances diagnostics"
139
136
  method_option :all,
140
- :type => :boolean,
141
- :desc => "Include all diagnostics"
137
+ type: :boolean,
138
+ desc: "Include all diagnostics"
142
139
  log_options
143
140
  test_base_path
144
141
  def diagnose(*args)
145
142
  update_config!
146
- perform("diagnose", "diagnose", args, :loader => @loader)
143
+ perform("diagnose", "diagnose", args, loader: @loader)
147
144
  end
148
145
 
149
146
  {
150
- :create => "Change instance state to create. " \
147
+ create: "Change instance state to create. " \
151
148
  "Start one or more instances",
152
- :converge => "Change instance state to converge. " \
149
+ converge: "Change instance state to converge. " \
153
150
  "Use a provisioner to configure one or more instances",
154
- :setup => "Change instance state to setup. " \
151
+ setup: "Change instance state to setup. " \
155
152
  "Prepare to run automated tests. " \
156
153
  "Install busser and related gems on one or more instances",
157
- :verify => "Change instance state to verify. " \
154
+ verify: "Change instance state to verify. " \
158
155
  "Run automated tests on one or more instances",
159
- :destroy => "Change instance state to destroy. " \
160
- "Delete all information for one or more instances"
156
+ destroy: "Change instance state to destroy. " \
157
+ "Delete all information for one or more instances",
161
158
  }.each do |action, short_desc|
162
159
  desc(
163
160
  "#{action} [INSTANCE|REGEXP|all]",
@@ -169,17 +166,17 @@ module Kitchen
169
166
  intermediate states will be executed. See http://kitchen.ci for further explanation.
170
167
  DESC
171
168
  method_option :concurrency,
172
- :aliases => "-c",
173
- :type => :numeric,
174
- :lazy_default => MAX_CONCURRENCY,
175
- :desc => <<-DESC.gsub(/^\s+/, "").gsub(/\n/, " ")
169
+ aliases: "-c",
170
+ type: :numeric,
171
+ lazy_default: MAX_CONCURRENCY,
172
+ desc: <<-DESC.gsub(/^\s+/, "").tr("\n", " ")
176
173
  Run a #{action} against all matching instances concurrently. Only N
177
174
  instances will run at the same time if a number is given.
178
175
  DESC
179
176
  method_option :parallel,
180
- :aliases => "-p",
181
- :type => :boolean,
182
- :desc => <<-DESC.gsub(/^\s+/, "").gsub(/\n/, " ")
177
+ aliases: "-p",
178
+ type: :boolean,
179
+ desc: <<-DESC.gsub(/^\s+/, "").tr("\n", " ")
183
180
  [Future DEPRECATION, use --concurrency]
184
181
  Run a #{action} against all matching instances concurrently.
185
182
  DESC
@@ -192,7 +189,7 @@ module Kitchen
192
189
  end
193
190
 
194
191
  desc "test [INSTANCE|REGEXP|all]",
195
- "Test (destroy, create, converge, setup, verify and destroy) one or more instances"
192
+ "Test (destroy, create, converge, setup, verify and destroy) one or more instances"
196
193
  long_desc <<-DESC
197
194
  The instance states are in order: destroy, create, converge, setup, verify, destroy.
198
195
  Test changes the state of one or more instances to destroyed, then executes
@@ -207,28 +204,28 @@ module Kitchen
207
204
  * never: instances will never be destroyed afterwards.
208
205
  DESC
209
206
  method_option :concurrency,
210
- :aliases => "-c",
211
- :type => :numeric,
212
- :lazy_default => MAX_CONCURRENCY,
213
- :desc => <<-DESC.gsub(/^\s+/, "").gsub(/\n/, " ")
207
+ aliases: "-c",
208
+ type: :numeric,
209
+ lazy_default: MAX_CONCURRENCY,
210
+ desc: <<-DESC.gsub(/^\s+/, "").tr("\n", " ")
214
211
  Run a test against all matching instances concurrently. Only N
215
212
  instances will run at the same time if a number is given.
216
213
  DESC
217
214
  method_option :parallel,
218
- :aliases => "-p",
219
- :type => :boolean,
220
- :desc => <<-DESC.gsub(/^\s+/, "").gsub(/\n/, " ")
215
+ aliases: "-p",
216
+ type: :boolean,
217
+ desc: <<-DESC.gsub(/^\s+/, "").tr("\n", " ")
221
218
  [Future DEPRECATION, use --concurrency]
222
219
  Run a test against all matching instances concurrently.
223
220
  DESC
224
221
  method_option :destroy,
225
- :aliases => "-d",
226
- :default => "passing",
227
- :desc => "Destroy strategy to use after testing (passing, always, never)."
222
+ aliases: "-d",
223
+ default: "passing",
224
+ desc: "Destroy strategy to use after testing (passing, always, never)."
228
225
  method_option :auto_init,
229
- :type => :boolean,
230
- :default => false,
231
- :desc => "Invoke init command if .kitchen.yml is missing"
226
+ type: :boolean,
227
+ default: false,
228
+ desc: "Invoke init command if .kitchen.yml is missing"
232
229
  test_base_path
233
230
  log_options
234
231
  def test(*args)
@@ -252,10 +249,10 @@ module Kitchen
252
249
  end
253
250
 
254
251
  desc "exec INSTANCE|REGEXP -c REMOTE_COMMAND",
255
- "Execute command on one or more instance"
252
+ "Execute command on one or more instance"
256
253
  method_option :command,
257
- :aliases => "-c",
258
- :desc => "execute via ssh"
254
+ aliases: "-c",
255
+ desc: "execute via ssh"
259
256
  log_options
260
257
  def exec(*args)
261
258
  update_config!
@@ -266,9 +263,9 @@ module Kitchen
266
263
  def version
267
264
  puts "Test Kitchen version #{Kitchen::VERSION}"
268
265
  end
269
- map %w[-v --version] => :version
266
+ map %w{-v --version} => :version
270
267
 
271
- desc "sink", "Show the Kitchen sink!", :hide => true
268
+ desc "sink", "Show the Kitchen sink!", hide: true
272
269
  def sink
273
270
  perform("sink", "sink")
274
271
  end
@@ -279,8 +276,8 @@ module Kitchen
279
276
  end
280
277
 
281
278
  register Kitchen::Generator::Init, "init",
282
- "init", "Adds some configuration to your cookbook so Kitchen can rock"
283
- long_desc <<-D, :for => "init"
279
+ "init", "Adds some configuration to your cookbook so Kitchen can rock"
280
+ long_desc <<-D, for: "init"
284
281
  Init will add Test Kitchen support to an existing project for
285
282
  convergence integration testing. A default .kitchen.yml file (which is
286
283
  intended to be customized) is created in the project's root directory
@@ -292,12 +289,11 @@ module Kitchen
292
289
  #
293
290
  # @author Fletcher Nichol <fnichol@nichol.ca>
294
291
  class Driver < Thor
295
-
296
292
  include PerformCommand
297
293
 
298
294
  register Kitchen::Generator::DriverCreate, "create",
299
- "create [NAME]", "Create a new Kitchen Driver gem project"
300
- long_desc <<-D, :for => "create"
295
+ "create [NAME]", "Create a new Kitchen Driver gem project"
296
+ long_desc <<-D, for: "create"
301
297
  Create will generate a project scaffold for a brand new Test Kitchen
302
298
  Driver RubyGem. For example:
303
299
 
@@ -315,8 +311,8 @@ module Kitchen
315
311
  relevant drivers will be returned.
316
312
  D
317
313
  method_option :chef_config_path,
318
- :default => nil,
319
- :desc => "Path to chef config file containing proxy configuration to use"
314
+ default: nil,
315
+ desc: "Path to chef config file containing proxy configuration to use"
320
316
  def discover
321
317
  perform("discover", "driver_discover", args)
322
318
  end
@@ -328,7 +324,7 @@ module Kitchen
328
324
  end
329
325
 
330
326
  register Kitchen::CLI::Driver, "driver",
331
- "driver", "Driver subcommands"
327
+ "driver", "Driver subcommands"
332
328
 
333
329
  no_tasks do
334
330
  def invoke_task(command, *args)