test-kitchen 1.3.1 → 1.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.cane +2 -0
  3. data/.gitignore +4 -0
  4. data/CHANGELOG.md +45 -0
  5. data/Rakefile +15 -0
  6. data/features/kitchen_action_commands.feature +12 -9
  7. data/features/kitchen_defaults.feature +38 -0
  8. data/features/kitchen_init_command.feature +0 -1
  9. data/features/kitchen_list_command.feature +2 -2
  10. data/features/kitchen_login_command.feature +7 -1
  11. data/features/kitchen_test_command.feature +4 -4
  12. data/lib/kitchen.rb +40 -11
  13. data/lib/kitchen/cli.rb +38 -22
  14. data/lib/kitchen/command/list.rb +5 -2
  15. data/lib/kitchen/config.rb +45 -18
  16. data/lib/kitchen/configurable.rb +137 -1
  17. data/lib/kitchen/data_munger.rb +248 -17
  18. data/lib/kitchen/driver.rb +1 -1
  19. data/lib/kitchen/driver/base.rb +1 -83
  20. data/lib/kitchen/driver/dummy.rb +0 -5
  21. data/lib/kitchen/driver/ssh_base.rb +177 -22
  22. data/lib/kitchen/instance.rb +140 -20
  23. data/lib/kitchen/logger.rb +43 -8
  24. data/lib/kitchen/login_command.rb +14 -5
  25. data/lib/kitchen/platform.rb +19 -0
  26. data/lib/kitchen/provisioner.rb +5 -3
  27. data/lib/kitchen/provisioner/base.rb +46 -48
  28. data/lib/kitchen/provisioner/chef/common_sandbox.rb +322 -0
  29. data/lib/kitchen/provisioner/chef_base.rb +179 -286
  30. data/lib/kitchen/provisioner/chef_solo.rb +11 -5
  31. data/lib/kitchen/provisioner/chef_zero.rb +108 -94
  32. data/lib/kitchen/provisioner/dummy.rb +47 -0
  33. data/lib/kitchen/provisioner/shell.rb +45 -12
  34. data/lib/kitchen/rake_tasks.rb +1 -1
  35. data/lib/kitchen/ssh.rb +1 -1
  36. data/lib/kitchen/thor_tasks.rb +1 -1
  37. data/lib/kitchen/transport.rb +54 -0
  38. data/lib/kitchen/transport/base.rb +146 -0
  39. data/lib/kitchen/transport/dummy.rb +75 -0
  40. data/lib/kitchen/transport/ssh.rb +325 -0
  41. data/lib/kitchen/transport/winrm.rb +508 -0
  42. data/lib/kitchen/transport/winrm/command_executor.rb +188 -0
  43. data/lib/kitchen/transport/winrm/file_transporter.rb +454 -0
  44. data/lib/kitchen/transport/winrm/logging.rb +50 -0
  45. data/lib/kitchen/transport/winrm/template.rb +74 -0
  46. data/lib/kitchen/transport/winrm/tmp_zip.rb +187 -0
  47. data/lib/kitchen/verifier.rb +55 -0
  48. data/lib/kitchen/verifier/base.rb +191 -0
  49. data/lib/kitchen/verifier/busser.rb +266 -0
  50. data/lib/kitchen/verifier/dummy.rb +75 -0
  51. data/lib/kitchen/version.rb +1 -1
  52. data/spec/kitchen/cli_spec.rb +56 -0
  53. data/spec/kitchen/config_spec.rb +61 -20
  54. data/spec/kitchen/configurable_spec.rb +327 -1
  55. data/spec/kitchen/data_munger_spec.rb +777 -14
  56. data/spec/kitchen/driver/base_spec.rb +7 -38
  57. data/spec/kitchen/driver/dummy_spec.rb +0 -29
  58. data/spec/kitchen/driver/ssh_base_spec.rb +580 -236
  59. data/spec/kitchen/driver_spec.rb +1 -0
  60. data/spec/kitchen/instance_spec.rb +383 -83
  61. data/spec/kitchen/login_command_spec.rb +29 -10
  62. data/spec/kitchen/platform_spec.rb +58 -2
  63. data/spec/kitchen/provisioner/base_spec.rb +170 -18
  64. data/spec/kitchen/provisioner/chef_base_spec.rb +454 -104
  65. data/spec/kitchen/provisioner/chef_solo_spec.rb +307 -104
  66. data/spec/kitchen/provisioner/chef_zero_spec.rb +561 -230
  67. data/spec/kitchen/provisioner/dummy_spec.rb +91 -0
  68. data/spec/kitchen/provisioner/shell_spec.rb +158 -56
  69. data/spec/kitchen/provisioner_spec.rb +37 -0
  70. data/spec/kitchen/ssh_spec.rb +19 -19
  71. data/spec/kitchen/transport/base_spec.rb +89 -0
  72. data/spec/kitchen/transport/ssh_spec.rb +1147 -0
  73. data/spec/kitchen/transport/winrm/command_executor_spec.rb +400 -0
  74. data/spec/kitchen/transport/winrm/file_transporter_spec.rb +876 -0
  75. data/spec/kitchen/transport/winrm/logging_spec.rb +92 -0
  76. data/spec/kitchen/transport/winrm/template_spec.rb +51 -0
  77. data/spec/kitchen/transport/winrm/tmp_zip_spec.rb +132 -0
  78. data/spec/kitchen/transport/winrm_spec.rb +1069 -0
  79. data/spec/kitchen/transport_spec.rb +112 -0
  80. data/spec/kitchen/verifier/base_spec.rb +310 -0
  81. data/spec/kitchen/verifier/busser_spec.rb +540 -0
  82. data/spec/kitchen/verifier/dummy_spec.rb +91 -0
  83. data/spec/kitchen/verifier_spec.rb +120 -0
  84. data/spec/kitchen_spec.rb +7 -0
  85. data/spec/spec_helper.rb +8 -0
  86. data/spec/support/powershell_max_size_spec.rb +40 -0
  87. data/support/busser_install_command.ps1 +14 -0
  88. data/support/busser_install_command.sh +15 -0
  89. data/support/check_files.ps1.erb +48 -0
  90. data/support/chef_base_init_command.ps1 +18 -0
  91. data/support/chef_base_init_command.sh +2 -0
  92. data/support/chef_base_install_command.ps1 +76 -0
  93. data/support/chef_base_install_command.sh +137 -0
  94. data/support/chef_zero_prepare_command_legacy.ps1 +9 -0
  95. data/support/chef_zero_prepare_command_legacy.sh +10 -0
  96. data/support/decode_files.ps1.erb +61 -0
  97. data/test-kitchen.gemspec +2 -0
  98. metadata +97 -8
  99. data/lib/kitchen/busser.rb +0 -316
  100. data/spec/kitchen/busser_spec.rb +0 -490
  101. data/support/chef_helpers.sh +0 -16
@@ -25,17 +25,20 @@ describe Kitchen::Provisioner::ChefSolo do
25
25
 
26
26
  let(:logged_output) { StringIO.new }
27
27
  let(:logger) { Logger.new(logged_output) }
28
+ let(:platform) { stub(:os_type => nil) }
29
+ let(:suite) { stub(:name => "fries") }
28
30
 
29
31
  let(:config) do
30
32
  { :test_base_path => "/b", :kitchen_root => "/r", :log_level => :info }
31
33
  end
32
34
 
33
- let(:suite) do
34
- stub(:name => "fries")
35
- end
36
-
37
35
  let(:instance) do
38
- stub(:name => "coolbeans", :logger => logger, :suite => suite)
36
+ stub(
37
+ :name => "coolbeans",
38
+ :logger => logger,
39
+ :suite => suite,
40
+ :platform => platform
41
+ )
39
42
  end
40
43
 
41
44
  let(:provisioner) do
@@ -44,14 +47,31 @@ describe Kitchen::Provisioner::ChefSolo do
44
47
 
45
48
  describe "default config" do
46
49
 
47
- it "sets :solo_rb to an empty Hash" do
48
- provisioner[:solo_rb].must_equal Hash.new
50
+ describe "for unix operating systems" do
51
+
52
+ before { platform.stubs(:os_type).returns("unix") }
53
+
54
+ it "sets :chef_solo_path to a path using :chef_omnibus_root" do
55
+ config[:chef_omnibus_root] = "/nice/place"
56
+
57
+ provisioner[:chef_solo_path].must_equal "/nice/place/bin/chef-solo"
58
+ end
49
59
  end
50
60
 
51
- it "sets :chef_solo_path to a path using :chef_omnibus_root" do
52
- config[:chef_omnibus_root] = "/nice/place"
61
+ describe "for windows operating systems" do
62
+
63
+ before { platform.stubs(:os_type).returns("windows") }
53
64
 
54
- provisioner[:chef_solo_path].must_equal "/nice/place/bin/chef-solo"
65
+ it "sets :chef_solo_path to a path using :chef_omnibus_root" do
66
+ config[:chef_omnibus_root] = "$env:systemdrive\\nice\\place"
67
+
68
+ provisioner[:chef_solo_path].
69
+ must_equal "$env:systemdrive\\nice\\place\\bin\\chef-solo.bat"
70
+ end
71
+ end
72
+
73
+ it "sets :solo_rb to an empty Hash" do
74
+ provisioner[:solo_rb].must_equal Hash.new
55
75
  end
56
76
  end
57
77
 
@@ -97,64 +117,104 @@ describe Kitchen::Provisioner::ChefSolo do
97
117
 
98
118
  describe "defaults" do
99
119
 
100
- before { provisioner.create_sandbox }
101
-
102
- it "sets node_name to the instance name" do
103
- file.must_include %{node_name "#{instance.name}"}
120
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
121
+ def self.common_solo_rb_specs
122
+ it "sets node_name to the instance name" do
123
+ file.must_include %{node_name "#{instance.name}"}
124
+ end
125
+
126
+ it "sets checksum_path" do
127
+ file.must_include %{checksum_path "#{base}checksums"}
128
+ end
129
+
130
+ it "sets file_backup_path" do
131
+ file.must_include %{file_backup_path "#{base}backup"}
132
+ end
133
+
134
+ it "sets cookbook_path" do
135
+ file.must_include %{cookbook_path } +
136
+ %{["#{base}cookbooks", "#{base}site-cookbooks"]}
137
+ end
138
+
139
+ it "sets data_bag_path" do
140
+ file.must_include %{data_bag_path "#{base}data_bags"}
141
+ end
142
+
143
+ it "sets environment_path" do
144
+ file.must_include %{environment_path "#{base}environments"}
145
+ end
146
+
147
+ it "sets node_path" do
148
+ file.must_include %{node_path "#{base}nodes"}
149
+ end
150
+
151
+ it "sets role_path" do
152
+ file.must_include %{role_path "#{base}roles"}
153
+ end
154
+
155
+ it "sets client_path" do
156
+ file.must_include %{client_path "#{base}clients"}
157
+ end
158
+
159
+ it "sets user_path" do
160
+ file.must_include %{user_path "#{base}users"}
161
+ end
162
+
163
+ it "sets validation_key" do
164
+ file.must_include %{validation_key "#{base}validation.pem"}
165
+ end
166
+
167
+ it "sets client_key" do
168
+ file.must_include %{client_key "#{base}client.pem"}
169
+ end
170
+
171
+ it "sets chef_server_url" do
172
+ file.must_include %{chef_server_url "http://127.0.0.1:8889"}
173
+ end
174
+
175
+ it "sets encrypted_data_bag_secret" do
176
+ file.must_include %{encrypted_data_bag_secret } +
177
+ %{"#{base}encrypted_data_bag_secret"}
178
+ end
104
179
  end
180
+ # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
105
181
 
106
- it "sets checksum_path" do
107
- file.must_include %{checksum_path "/tmp/kitchen/checksums"}
108
- end
182
+ describe "for unix os types" do
109
183
 
110
- it "sets file_backup_path" do
111
- file.must_include %{file_backup_path "/tmp/kitchen/backup"}
112
- end
184
+ before do
185
+ platform.stubs(:os_type).returns("unix")
186
+ provisioner.create_sandbox
187
+ end
113
188
 
114
- it "sets cookbook_path" do
115
- file.must_include %{cookbook_path } +
116
- %{["/tmp/kitchen/cookbooks", "/tmp/kitchen/site-cookbooks"]}
117
- end
189
+ let(:base) { "/tmp/kitchen/" }
118
190
 
119
- it "sets data_bag_path" do
120
- file.must_include %{data_bag_path "/tmp/kitchen/data_bags"}
191
+ common_solo_rb_specs
121
192
  end
122
193
 
123
- it "sets environment_path" do
124
- file.must_include %{environment_path "/tmp/kitchen/environments"}
125
- end
194
+ describe "for windows os types with full path" do
126
195
 
127
- it "sets node_path" do
128
- file.must_include %{node_path "/tmp/kitchen/nodes"}
129
- end
196
+ before do
197
+ platform.stubs(:os_type).returns("windows")
198
+ config[:root_path] = "\\a\\b"
199
+ provisioner.create_sandbox
200
+ end
130
201
 
131
- it "sets role_path" do
132
- file.must_include %{role_path "/tmp/kitchen/roles"}
133
- end
134
-
135
- it "sets client_path" do
136
- file.must_include %{client_path "/tmp/kitchen/clients"}
137
- end
202
+ let(:base) { "\\\\a\\\\b\\\\" }
138
203
 
139
- it "sets user_path" do
140
- file.must_include %{user_path "/tmp/kitchen/users"}
204
+ common_solo_rb_specs
141
205
  end
142
206
 
143
- it "sets validation_key" do
144
- file.must_include %{validation_key "/tmp/kitchen/validation.pem"}
145
- end
207
+ describe "for windows os types with $env:TEMP prefixed paths" do
146
208
 
147
- it "sets client_key" do
148
- file.must_include %{client_key "/tmp/kitchen/client.pem"}
149
- end
209
+ before do
210
+ platform.stubs(:os_type).returns("windows")
211
+ config[:root_path] = "$env:TEMP\\a"
212
+ provisioner.create_sandbox
213
+ end
150
214
 
151
- it "sets chef_server_url" do
152
- file.must_include %{chef_server_url "http://127.0.0.1:8889"}
153
- end
215
+ let(:base) { "\#{ENV['TEMP']}\\\\a\\\\" }
154
216
 
155
- it "sets encrypted_data_bag_secret" do
156
- file.must_include %{encrypted_data_bag_secret } +
157
- %{"/tmp/kitchen/encrypted_data_bag_secret"}
217
+ common_solo_rb_specs
158
218
  end
159
219
  end
160
220
 
@@ -171,7 +231,7 @@ describe Kitchen::Provisioner::ChefSolo do
171
231
  file.must_include %{client_key "lol"}
172
232
  end
173
233
 
174
- it " supports adding new configuration" do
234
+ it "supports adding new configuration" do
175
235
  config[:solo_rb] = {
176
236
  :dark_secret => "golang"
177
237
  }
@@ -222,81 +282,224 @@ describe Kitchen::Provisioner::ChefSolo do
222
282
  def sandbox_path(path)
223
283
  Pathname.new(provisioner.sandbox_path).join(path)
224
284
  end
225
-
226
285
  end
227
286
 
228
287
  describe "#run_command" do
229
288
 
230
289
  let(:cmd) { provisioner.run_command }
231
290
 
232
- it "uses bourne shell" do
233
- cmd.must_match(/\Ash -c '$/)
234
- cmd.must_match(/'\Z/)
235
- end
291
+ describe "for bourne shells" do
236
292
 
237
- it "uses sudo for chef-solo when configured" do
238
- config[:chef_omnibus_root] = "/c"
239
- config[:sudo] = true
293
+ before { platform.stubs(:shell_type).returns("bourne") }
240
294
 
241
- cmd.must_match regexify("sudo -E /c/bin/chef-solo ", :partial_line)
242
- end
295
+ it "uses bourne shell" do
296
+ cmd.must_match(/\Ash -c '$/)
297
+ cmd.must_match(/'\Z/)
298
+ end
243
299
 
244
- it "does not use sudo for chef-solo when configured" do
245
- config[:chef_omnibus_root] = "/c"
246
- config[:sudo] = false
300
+ it "ends with a single quote" do
301
+ cmd.must_match(/'\Z/)
302
+ end
247
303
 
248
- cmd.must_match regexify("chef-solo ", :partial_line)
249
- cmd.wont_match regexify("sudo -E /c/bin/chef-solo ", :partial_line)
250
- end
304
+ it "exports http_proxy & HTTP_PROXY when :http_proxy is set" do
305
+ config[:http_proxy] = "http://proxy"
251
306
 
252
- it "sets config flag on chef-solo" do
253
- cmd.must_match regexify(" --config /tmp/kitchen/solo.rb", :partial_line)
254
- end
307
+ cmd.lines.to_a[1..2].must_equal([
308
+ %{http_proxy="http://proxy"; export http_proxy\n},
309
+ %{HTTP_PROXY="http://proxy"; export HTTP_PROXY\n}
310
+ ])
311
+ end
255
312
 
256
- it "sets config flag for custom root_path" do
257
- config[:root_path] = "/a/b"
313
+ it "exports https_proxy & HTTPS_PROXY when :https_proxy is set" do
314
+ config[:https_proxy] = "https://proxy"
258
315
 
259
- cmd.must_match regexify(" --config /a/b/solo.rb", :partial_line)
260
- end
316
+ cmd.lines.to_a[1..2].must_equal([
317
+ %{https_proxy="https://proxy"; export https_proxy\n},
318
+ %{HTTPS_PROXY="https://proxy"; export HTTPS_PROXY\n}
319
+ ])
320
+ end
261
321
 
262
- it "sets json attributes flag on chef-solo" do
263
- cmd.must_match regexify(
264
- " --json-attributes /tmp/kitchen/dna.json", :partial_line)
265
- end
322
+ it "exports all http proxy variables when both are set" do
323
+ config[:http_proxy] = "http://proxy"
324
+ config[:https_proxy] = "https://proxy"
266
325
 
267
- it "sets json attribtes flag for custom root_path" do
268
- config[:root_path] = "/booyah"
326
+ cmd.lines.to_a[1..4].must_equal([
327
+ %{http_proxy="http://proxy"; export http_proxy\n},
328
+ %{HTTP_PROXY="http://proxy"; export HTTP_PROXY\n},
329
+ %{https_proxy="https://proxy"; export https_proxy\n},
330
+ %{HTTPS_PROXY="https://proxy"; export HTTPS_PROXY\n}
331
+ ])
332
+ end
269
333
 
270
- cmd.must_match regexify(
271
- " --json-attributes /booyah/dna.json", :partial_line)
272
- end
334
+ it "does no powershell PATH reloading for older chef omnibus packages" do
335
+ cmd.wont_match regexify(%{[System.Environment]::})
336
+ end
273
337
 
274
- it "sets log level flag on chef-solo to auto by default" do
275
- cmd.must_match regexify(" --log_level auto", :partial_line)
276
- end
338
+ it "uses sudo for chef-solo when configured" do
339
+ config[:chef_omnibus_root] = "/c"
340
+ config[:sudo] = true
277
341
 
278
- it "set log level flag for custom level" do
279
- config[:log_level] = :extreme
342
+ cmd.must_match regexify("sudo -E /c/bin/chef-solo ", :partial_line)
343
+ end
280
344
 
281
- cmd.must_match regexify(" --log_level extreme", :partial_line)
282
- end
345
+ it "does not use sudo for chef-solo when configured" do
346
+ config[:chef_omnibus_root] = "/c"
347
+ config[:sudo] = false
283
348
 
284
- it "sets force formatter flag on chef-solo" do
285
- cmd.must_match regexify(" --force-formatter", :partial_line)
286
- end
349
+ cmd.must_match regexify("chef-solo ", :partial_line)
350
+ cmd.wont_match regexify("sudo -E /c/bin/chef-solo ", :partial_line)
351
+ end
287
352
 
288
- it "sets no color flag on chef-solo" do
289
- cmd.must_match regexify(" --no-color", :partial_line)
290
- end
353
+ it "sets config flag on chef-solo" do
354
+ cmd.must_match regexify(" --config /tmp/kitchen/solo.rb", :partial_line)
355
+ end
356
+
357
+ it "sets config flag for custom root_path" do
358
+ config[:root_path] = "/a/b"
359
+
360
+ cmd.must_match regexify(" --config /a/b/solo.rb", :partial_line)
361
+ end
362
+
363
+ it "sets json attributes flag on chef-solo" do
364
+ cmd.must_match regexify(
365
+ " --json-attributes /tmp/kitchen/dna.json", :partial_line)
366
+ end
367
+
368
+ it "sets json attribtes flag for custom root_path" do
369
+ config[:root_path] = "/booyah"
291
370
 
292
- it "does not set logfile flag by default" do
293
- cmd.wont_match regexify(" --logfile ", :partial_line)
371
+ cmd.must_match regexify(
372
+ " --json-attributes /booyah/dna.json", :partial_line)
373
+ end
374
+
375
+ it "sets log level flag on chef-solo to auto by default" do
376
+ cmd.must_match regexify(" --log_level auto", :partial_line)
377
+ end
378
+
379
+ it "set log level flag for custom level" do
380
+ config[:log_level] = :extreme
381
+
382
+ cmd.must_match regexify(" --log_level extreme", :partial_line)
383
+ end
384
+
385
+ it "sets force formatter flag on chef-solo" do
386
+ cmd.must_match regexify(" --force-formatter", :partial_line)
387
+ end
388
+
389
+ it "sets no color flag on chef-solo" do
390
+ cmd.must_match regexify(" --no-color", :partial_line)
391
+ end
392
+
393
+ it "does not set logfile flag by default" do
394
+ cmd.wont_match regexify(" --logfile ", :partial_line)
395
+ end
396
+
397
+ it "sets logfile flag for custom value" do
398
+ config[:log_file] = "/a/out.log"
399
+
400
+ cmd.must_match regexify(" --logfile /a/out.log", :partial_line)
401
+ end
294
402
  end
295
403
 
296
- it "sets logfile flag for custom value" do
297
- config[:log_file] = "/a/out.log"
404
+ describe "for powershell shells on windows os types" do
405
+
406
+ before do
407
+ platform.stubs(:shell_type).returns("powershell")
408
+ platform.stubs(:os_type).returns("windows")
409
+ end
410
+
411
+ it "exports http_proxy & HTTP_PROXY when :http_proxy is set" do
412
+ config[:http_proxy] = "http://proxy"
413
+
414
+ cmd.lines.to_a[0..1].must_equal([
415
+ %{$env:http_proxy = "http://proxy"\n},
416
+ %{$env:HTTP_PROXY = "http://proxy"\n}
417
+ ])
418
+ end
419
+
420
+ it "exports https_proxy & HTTPS_PROXY when :https_proxy is set" do
421
+ config[:https_proxy] = "https://proxy"
422
+
423
+ cmd.lines.to_a[0..1].must_equal([
424
+ %{$env:https_proxy = "https://proxy"\n},
425
+ %{$env:HTTPS_PROXY = "https://proxy"\n}
426
+ ])
427
+ end
428
+
429
+ it "exports all http proxy variables when both are set" do
430
+ config[:http_proxy] = "http://proxy"
431
+ config[:https_proxy] = "https://proxy"
432
+
433
+ cmd.lines.to_a[0..3].must_equal([
434
+ %{$env:http_proxy = "http://proxy"\n},
435
+ %{$env:HTTP_PROXY = "http://proxy"\n},
436
+ %{$env:https_proxy = "https://proxy"\n},
437
+ %{$env:HTTPS_PROXY = "https://proxy"\n}
438
+ ])
439
+ end
440
+
441
+ it "reloads PATH for older chef omnibus packages" do
442
+ cmd.must_match regexify("$env:PATH = " +
443
+ %{[System.Environment]::GetEnvironmentVariable("PATH","Machine")})
444
+ end
445
+
446
+ it "calls the chef-solo command from :chef_solo_path" do
447
+ config[:chef_solo_path] = "\\r\\chef-solo.bat"
448
+
449
+ cmd.must_match regexify("& \\r\\chef-solo.bat ", :partial_line)
450
+ end
451
+
452
+ it "sets config flag on chef-solo" do
453
+ cmd.must_match regexify(
454
+ " --config $env:TEMP\\kitchen\\solo.rb", :partial_line)
455
+ end
456
+
457
+ it "sets config flag for custom root_path" do
458
+ config[:root_path] = "\\a\\b"
459
+
460
+ cmd.must_match regexify(
461
+ " --config \\a\\b\\solo.rb", :partial_line)
462
+ end
463
+
464
+ it "sets json attributes flag on chef-solo" do
465
+ cmd.must_match regexify(
466
+ " --json-attributes $env:TEMP\\kitchen\\dna.json", :partial_line)
467
+ end
468
+
469
+ it "sets json attribtes flag for custom root_path" do
470
+ config[:root_path] = "\\booyah"
471
+
472
+ cmd.must_match regexify(
473
+ " --json-attributes \\booyah\\dna.json", :partial_line)
474
+ end
298
475
 
299
- cmd.must_match regexify(" --logfile /a/out.log", :partial_line)
476
+ it "sets log level flag on chef-solo to auto by default" do
477
+ cmd.must_match regexify(" --log_level auto", :partial_line)
478
+ end
479
+
480
+ it "set log level flag for custom level" do
481
+ config[:log_level] = :extreme
482
+
483
+ cmd.must_match regexify(" --log_level extreme", :partial_line)
484
+ end
485
+
486
+ it "sets force formatter flag on chef-solo" do
487
+ cmd.must_match regexify(" --force-formatter", :partial_line)
488
+ end
489
+
490
+ it "sets no color flag on chef-solo" do
491
+ cmd.must_match regexify(" --no-color", :partial_line)
492
+ end
493
+
494
+ it "does not set logfile flag by default" do
495
+ cmd.wont_match regexify(" --logfile ", :partial_line)
496
+ end
497
+
498
+ it "sets logfile flag for custom value" do
499
+ config[:log_file] = "\\a\\out.log"
500
+
501
+ cmd.must_match regexify(" --logfile \\a\\out.log", :partial_line)
502
+ end
300
503
  end
301
504
  end
302
505