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
@@ -24,11 +24,8 @@ require "kitchen/errors"
24
24
  require "kitchen/configurable"
25
25
 
26
26
  module Kitchen
27
-
28
27
  module Thing
29
-
30
28
  class Tiny
31
-
32
29
  include Kitchen::Configurable
33
30
 
34
31
  attr_reader :instance
@@ -40,12 +37,10 @@ module Kitchen
40
37
  end
41
38
 
42
39
  class Versioned < Tiny
43
-
44
40
  plugin_version "1.8.17"
45
41
  end
46
42
 
47
43
  class StaticDefaults
48
-
49
44
  include Kitchen::Configurable
50
45
 
51
46
  default_config :beans, "kidney"
@@ -53,7 +48,7 @@ module Kitchen
53
48
  default_config :edible, true
54
49
  default_config :fetch_command, "curl"
55
50
  default_config :success_path, "./success"
56
- default_config :bunch_of_paths, %W[./a ./b ./c]
51
+ default_config :bunch_of_paths, %w{./a ./b ./c}
57
52
  default_config :beans_url do |subject|
58
53
  "http://gim.me/#{subject[:beans]}"
59
54
  end
@@ -84,7 +79,6 @@ module Kitchen
84
79
  end
85
80
 
86
81
  class SubclassDefaults < StaticDefaults
87
-
88
82
  default_config :yea, "ya"
89
83
  default_config :fetch_command, "wget"
90
84
  default_config :fetch_url, "http://no.beans"
@@ -99,11 +93,10 @@ module Kitchen
99
93
  end
100
94
 
101
95
  describe Kitchen::Configurable do
102
-
103
96
  let(:config) { Hash.new }
104
97
  let(:platform) { stub }
105
98
  let(:instance) do
106
- stub(:name => "coolbeans", :to_str => "<instance>", :platform => platform)
99
+ stub(name: "coolbeans", to_str: "<instance>", platform: platform)
107
100
  end
108
101
 
109
102
  let(:subject) do
@@ -111,14 +104,13 @@ describe Kitchen::Configurable do
111
104
  end
112
105
 
113
106
  describe "creation and setup" do
114
-
115
107
  it "#instance returns its instance" do
116
108
  subject.instance.must_equal instance
117
109
  end
118
110
 
119
111
  it "#finalize_config! raises ClientError if instance is nil" do
120
- proc { Kitchen::Thing::Tiny.new({}).finalize_config!(nil) }.
121
- must_raise(Kitchen::ClientError)
112
+ proc { Kitchen::Thing::Tiny.new({}).finalize_config!(nil) }
113
+ .must_raise(Kitchen::ClientError)
122
114
  end
123
115
 
124
116
  it "#finalize_config! returns self for chaining" do
@@ -128,22 +120,19 @@ describe Kitchen::Configurable do
128
120
  end
129
121
 
130
122
  describe "configuration" do
131
-
132
123
  describe "provided from the outside" do
133
-
134
124
  it "returns provided config" do
135
- config[:fruit] = %w[apples oranges]
125
+ config[:fruit] = %w{apples oranges}
136
126
  config[:cool_enough] = true
137
127
 
138
- subject[:fruit].must_equal %w[apples oranges]
128
+ subject[:fruit].must_equal %w{apples oranges}
139
129
  subject[:cool_enough].must_equal true
140
130
  end
141
131
  end
142
132
 
143
133
  describe "using static default_config statements" do
144
-
145
134
  let(:config) do
146
- { :need_it => true, :a_default => true }
135
+ { need_it: true, a_default: true }
147
136
  end
148
137
 
149
138
  let(:subject) do
@@ -183,9 +172,8 @@ describe Kitchen::Configurable do
183
172
  end
184
173
 
185
174
  describe "using inherited static default_config statements" do
186
-
187
175
  let(:config) do
188
- { :need_it => true, :a_default => "please" }
176
+ { need_it: true, a_default: "please" }
189
177
  end
190
178
 
191
179
  let(:subject) do
@@ -216,9 +204,8 @@ describe Kitchen::Configurable do
216
204
  end
217
205
 
218
206
  describe "using static required_config statements" do
219
-
220
207
  let(:config) do
221
- { :a_default => true }
208
+ { a_default: true }
222
209
  end
223
210
 
224
211
  let(:subject) do
@@ -269,7 +256,6 @@ describe Kitchen::Configurable do
269
256
  end
270
257
 
271
258
  describe "using inherited static require_config statements" do
272
-
273
259
  let(:subject) do
274
260
  Kitchen::Thing::SubclassDefaults.new(config).finalize_config!(instance)
275
261
  end
@@ -301,9 +287,8 @@ describe Kitchen::Configurable do
301
287
  end
302
288
 
303
289
  describe "using static expand_path_for statements" do
304
-
305
290
  let(:config) do
306
- { :need_it => "a", :a_default => "b", :kitchen_root => "/tmp/yo/self" }
291
+ { need_it: "a", a_default: "b", kitchen_root: "/tmp/yo/self" }
307
292
  end
308
293
 
309
294
  let(:subject) do
@@ -327,9 +312,9 @@ describe Kitchen::Configurable do
327
312
  end
328
313
 
329
314
  it "expands all items if path is an array" do
330
- paths = %W[
315
+ paths = %w{
331
316
  /tmp/yo/self/a /tmp/yo/self/b /tmp/yo/self/c
332
- ]
317
+ }
333
318
  os_safe_paths = paths.collect { |path| os_safe_root_path(path) }
334
319
  subject[:bunch_of_paths].must_equal os_safe_paths
335
320
  end
@@ -361,9 +346,8 @@ describe Kitchen::Configurable do
361
346
  end
362
347
 
363
348
  describe "using inherited static expand_path_for statements" do
364
-
365
349
  let(:config) do
366
- { :need_it => "a", :a_default => "please", :kitchen_root => "/rooty" }
350
+ { need_it: "a", a_default: "please", kitchen_root: "/rooty" }
367
351
  end
368
352
 
369
353
  let(:subject) do
@@ -382,7 +366,7 @@ describe Kitchen::Configurable do
382
366
  end
383
367
 
384
368
  it "#config_keys returns an array of config key names" do
385
- subject = Kitchen::Thing::Tiny.new(:ice_cream => "dragon")
369
+ subject = Kitchen::Thing::Tiny.new(ice_cream: "dragon")
386
370
 
387
371
  subject.config_keys.sort.must_equal [:ice_cream]
388
372
  end
@@ -393,14 +377,13 @@ describe Kitchen::Configurable do
393
377
  end
394
378
 
395
379
  describe "#diagnose" do
396
-
397
380
  it "returns an empty hash for no config" do
398
381
  subject.diagnose.must_equal Hash.new
399
382
  end
400
383
 
401
384
  it "returns a hash of config" do
402
385
  config[:alpha] = "beta"
403
- subject.diagnose.must_equal(:alpha => "beta")
386
+ subject.diagnose.must_equal(alpha: "beta")
404
387
  end
405
388
 
406
389
  it "returns a hash with sorted keys" do
@@ -412,35 +395,33 @@ describe Kitchen::Configurable do
412
395
  end
413
396
 
414
397
  describe "#diagnose_plugin" do
415
-
416
398
  it "returns a plugin hash for a plugin without version" do
417
399
  subject.diagnose_plugin.must_equal(
418
- :name => "Tiny", :class => "Kitchen::Thing::Tiny",
419
- :version => nil, :api_version => nil
400
+ name: "Tiny", class: "Kitchen::Thing::Tiny",
401
+ version: nil, api_version: nil
420
402
  )
421
403
  end
422
404
 
423
405
  it "returns a plugin hash for a plugin with version" do
424
406
  subject = Kitchen::Thing::Versioned.new(config).finalize_config!(instance)
425
407
  subject.diagnose_plugin.must_equal(
426
- :name => "Versioned", :class => "Kitchen::Thing::Versioned",
427
- :version => "1.8.17", :api_version => nil
408
+ name: "Versioned", class: "Kitchen::Thing::Versioned",
409
+ version: "1.8.17", api_version: nil
428
410
  )
429
411
  end
430
412
  end
431
413
 
432
414
  describe "#calculate_path" do
433
-
434
415
  let(:config) do
435
- { :test_base_path => "/the/basest" }
416
+ { test_base_path: "/the/basest" }
436
417
  end
437
418
 
438
419
  let(:suite) do
439
- stub(:name => "ultimate")
420
+ stub(name: "ultimate")
440
421
  end
441
422
 
442
423
  let(:instance) do
443
- stub(:name => "coolbeans", :to_str => "<instance>", :suite => suite)
424
+ stub(name: "coolbeans", to_str: "<instance>", suite: suite)
444
425
  end
445
426
 
446
427
  let(:subject) do
@@ -457,7 +438,6 @@ describe Kitchen::Configurable do
457
438
  end
458
439
 
459
440
  describe "for directories" do
460
-
461
441
  before do
462
442
  FileUtils.mkdir_p(File.join(Dir.pwd, "winner"))
463
443
  FileUtils.mkdir_p("/the/basest/winner")
@@ -465,8 +445,8 @@ describe Kitchen::Configurable do
465
445
  end
466
446
 
467
447
  it "prefers a path containing base path and suite name if it exists" do
468
- subject.calculate_path("winner").
469
- must_equal "/the/basest/ultimate/winner"
448
+ subject.calculate_path("winner")
449
+ .must_equal "/the/basest/ultimate/winner"
470
450
  end
471
451
 
472
452
  it "prefers a path containing base path if it exists" do
@@ -492,13 +472,12 @@ describe Kitchen::Configurable do
492
472
  it "uses a custom base path" do
493
473
  FileUtils.mkdir_p("/custom/ultimate/winner")
494
474
 
495
- subject.calculate_path("winner", :base_path => "/custom").
496
- must_equal "/custom/ultimate/winner"
475
+ subject.calculate_path("winner", base_path: "/custom")
476
+ .must_equal "/custom/ultimate/winner"
497
477
  end
498
478
  end
499
479
 
500
480
  describe "for files" do
501
-
502
481
  before do
503
482
  FileUtils.mkdir_p(Dir.pwd)
504
483
  FileUtils.touch(File.join(Dir.pwd, "winner"))
@@ -509,15 +488,15 @@ describe Kitchen::Configurable do
509
488
  end
510
489
 
511
490
  it "prefers a path containing base path and suite name if it exists" do
512
- subject.calculate_path("winner", :type => :file).
513
- must_equal "/the/basest/ultimate/winner"
491
+ subject.calculate_path("winner", type: :file)
492
+ .must_equal "/the/basest/ultimate/winner"
514
493
  end
515
494
 
516
495
  it "prefers a path containing base path if it exists" do
517
496
  FileUtils.rm_rf("/the/basest/ultimate/winner")
518
497
 
519
- subject.calculate_path("winner", :type => :file).
520
- must_equal "/the/basest/winner"
498
+ subject.calculate_path("winner", type: :file)
499
+ .must_equal "/the/basest/winner"
521
500
  end
522
501
 
523
502
  it "prefers a path in the current working directory if it exists" do
@@ -525,7 +504,7 @@ describe Kitchen::Configurable do
525
504
  FileUtils.rm_rf("/the/basest/winner")
526
505
  pwd_dir = File.join(Dir.pwd, "winner")
527
506
 
528
- subject.calculate_path("winner", :type => :file).must_equal pwd_dir
507
+ subject.calculate_path("winner", type: :file).must_equal pwd_dir
529
508
  end
530
509
 
531
510
  it "raises a UserError if test_base_path key is not set" do
@@ -538,14 +517,13 @@ describe Kitchen::Configurable do
538
517
  FileUtils.mkdir_p("/custom/ultimate")
539
518
  FileUtils.touch(File.join("/custom/ultimate", "winner"))
540
519
 
541
- subject.calculate_path("winner", :type => :file, :base_path => "/custom").
542
- must_equal "/custom/ultimate/winner"
520
+ subject.calculate_path("winner", type: :file, base_path: "/custom")
521
+ .must_equal "/custom/ultimate/winner"
543
522
  end
544
523
  end
545
524
  end
546
525
 
547
526
  describe "#remote_path_join" do
548
-
549
527
  it "returns unix style path separators for unix os_type" do
550
528
  platform.stubs(:os_type).returns("unix")
551
529
 
@@ -555,36 +533,35 @@ describe Kitchen::Configurable do
555
533
  it "returns windows style path separators for windows os_type" do
556
534
  platform.stubs(:os_type).returns("windows")
557
535
 
558
- subject.remote_path_join("a", "b", "c").must_equal "a\\b\\c"
536
+ subject.remote_path_join("a", "b", "c").must_equal 'a\\b\\c'
559
537
  end
560
538
 
561
539
  it "accepts combinations of strings and arrays" do
562
540
  platform.stubs(:os_type).returns("unix")
563
541
 
564
- subject.remote_path_join(%W[a b], "c", %W[d e]).must_equal "a/b/c/d/e"
542
+ subject.remote_path_join(%w{a b}, "c", %w{d e}).must_equal "a/b/c/d/e"
565
543
  end
566
544
 
567
545
  it "accepts a single array" do
568
546
  platform.stubs(:os_type).returns("windows")
569
547
 
570
- subject.remote_path_join(%W[a b]).must_equal "a\\b"
548
+ subject.remote_path_join(%w{a b}).must_equal 'a\\b'
571
549
  end
572
550
 
573
551
  it "converts all windows path separators to unix for unix os_type" do
574
552
  platform.stubs(:os_type).returns("unix")
575
553
 
576
- subject.remote_path_join("\\a\\b", "c/d").must_equal "/a/b/c/d"
554
+ subject.remote_path_join('\\a\\b', "c/d").must_equal "/a/b/c/d"
577
555
  end
578
556
 
579
557
  it "converts all unix path separators to windows for windows os_type" do
580
558
  platform.stubs(:os_type).returns("windows")
581
559
 
582
- subject.remote_path_join("/a/b", "c\\d").must_equal "\\a\\b\\c\\d"
560
+ subject.remote_path_join("/a/b", 'c\\d').must_equal '\\a\\b\\c\\d'
583
561
  end
584
562
  end
585
563
 
586
564
  describe "#windows_os?" do
587
-
588
565
  it "for windows type platform returns true" do
589
566
  platform.stubs(:os_type).returns("windows")
590
567
 
@@ -611,7 +588,6 @@ describe Kitchen::Configurable do
611
588
  end
612
589
 
613
590
  describe "#unix_os?" do
614
-
615
591
  it "for windows type platform returns false" do
616
592
  platform.stubs(:os_type).returns("windows")
617
593
 
@@ -638,7 +614,6 @@ describe Kitchen::Configurable do
638
614
  end
639
615
 
640
616
  describe "#powershell_shell?" do
641
-
642
617
  it "for powershell type shell returns true" do
643
618
  platform.stubs(:shell_type).returns("powershell")
644
619
 
@@ -665,7 +640,6 @@ describe Kitchen::Configurable do
665
640
  end
666
641
 
667
642
  describe "#bourne_shell?" do
668
-
669
643
  it "for powershell type shell returns false" do
670
644
  platform.stubs(:shell_type).returns("powershell")
671
645
 
@@ -692,24 +666,22 @@ describe Kitchen::Configurable do
692
666
  end
693
667
 
694
668
  describe "#shell_env_var" do
695
-
696
669
  it "for powershell type shells returns a powershell environment variable" do
697
670
  platform.stubs(:shell_type).returns("powershell")
698
671
 
699
- subject.send(:shell_env_var, "foo", "bar").
700
- must_equal %{$env:foo = "bar"}
672
+ subject.send(:shell_env_var, "foo", "bar")
673
+ .must_equal %{$env:foo = "bar"}
701
674
  end
702
675
 
703
676
  it "for bourne type shells returns a bourne environment variable" do
704
677
  platform.stubs(:shell_type).returns("bourne")
705
678
 
706
- subject.send(:shell_env_var, "foo", "bar").
707
- must_equal %{foo="bar"; export foo}
679
+ subject.send(:shell_env_var, "foo", "bar")
680
+ .must_equal %{foo="bar"; export foo}
708
681
  end
709
682
  end
710
683
 
711
684
  describe "#shell_var" do
712
-
713
685
  it "for powershell type shells returns a powershell variable" do
714
686
  platform.stubs(:shell_type).returns("powershell")
715
687
 
@@ -724,7 +696,6 @@ describe Kitchen::Configurable do
724
696
  end
725
697
 
726
698
  describe "#wrap_shell_code" do
727
-
728
699
  let(:cmd) { subject.send(:wrap_shell_code, "mkdir foo") }
729
700
 
730
701
  before do
@@ -742,7 +713,6 @@ describe Kitchen::Configurable do
742
713
  end
743
714
 
744
715
  describe "for bourne shells" do
745
-
746
716
  before { platform.stubs(:shell_type).returns("bourne") }
747
717
 
748
718
  it "uses bourne shell (sh)" do
@@ -959,7 +929,6 @@ describe Kitchen::Configurable do
959
929
  end
960
930
 
961
931
  describe "for powershell shells" do
962
-
963
932
  before { platform.stubs(:shell_type).returns("powershell") }
964
933
 
965
934
  it "uses powershell shell" do
@@ -1117,14 +1086,13 @@ describe Kitchen::Configurable do
1117
1086
  end
1118
1087
 
1119
1088
  describe "#logger" do
1120
-
1121
1089
  before { @klog = Kitchen.logger }
1122
1090
  after { Kitchen.logger = @klog }
1123
1091
 
1124
1092
  it "returns the instance's logger" do
1125
1093
  logger = stub("logger")
1126
- instance = stub(:logger => logger)
1127
- subject = Kitchen::Thing::Tiny.new(config.merge(:instance => instance))
1094
+ instance = stub(logger: logger)
1095
+ subject = Kitchen::Thing::Tiny.new(config.merge(instance: instance))
1128
1096
  subject.send(:logger).must_equal logger
1129
1097
  end
1130
1098
 
@@ -21,33 +21,30 @@ require_relative "../spec_helper"
21
21
  require "kitchen/data_munger"
22
22
 
23
23
  module Kitchen # rubocop:disable Metrics/ModuleLength
24
-
25
24
  describe DataMunger do
26
-
27
25
  describe "#platform_data" do
28
-
29
26
  it "returns an array of platform data" do
30
27
  DataMunger.new(
31
- :platforms => [
28
+ platforms: [
32
29
  {
33
- :name => "one",
34
- :stuff => "junk"
30
+ name: "one",
31
+ stuff: "junk",
35
32
  },
36
33
  {
37
- :name => "two",
38
- :misc => "things"
39
- }
34
+ name: "two",
35
+ misc: "things",
36
+ },
40
37
  ]
41
38
  ).platform_data.must_equal([
42
- {
43
- :name => "one",
44
- :stuff => "junk"
45
- },
46
- {
47
- :name => "two",
48
- :misc => "things"
49
- }
50
- ])
39
+ {
40
+ name: "one",
41
+ stuff: "junk",
42
+ },
43
+ {
44
+ name: "two",
45
+ misc: "things",
46
+ },
47
+ ])
51
48
  end
52
49
 
53
50
  it "returns an empty array if platforms is not defined" do
@@ -56,29 +53,28 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
56
53
  end
57
54
 
58
55
  describe "#suite_data" do
59
-
60
56
  it "returns an array of suite data" do
61
57
  DataMunger.new(
62
- :suites => [
58
+ suites: [
63
59
  {
64
- :name => "one",
65
- :stuff => "junk"
60
+ name: "one",
61
+ stuff: "junk",
66
62
  },
67
63
  {
68
- :name => "two",
69
- :misc => "things"
70
- }
64
+ name: "two",
65
+ misc: "things",
66
+ },
71
67
  ]
72
68
  ).suite_data.must_equal([
73
- {
74
- :name => "one",
75
- :stuff => "junk"
76
- },
77
- {
78
- :name => "two",
79
- :misc => "things"
80
- }
81
- ])
69
+ {
70
+ name: "one",
71
+ stuff: "junk",
72
+ },
73
+ {
74
+ name: "two",
75
+ misc: "things",
76
+ },
77
+ ])
82
78
  end
83
79
 
84
80
  it "returns an empty array if suites is not defined" do
@@ -87,18 +83,15 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
87
83
  end
88
84
 
89
85
  DATA_KEYS = {
90
- :driver => :name,
91
- :provisioner => :name,
92
- :transport => :name,
93
- :verifier => :name
94
- }
86
+ driver: :name,
87
+ provisioner: :name,
88
+ transport: :name,
89
+ verifier: :name,
90
+ }.freeze
95
91
 
96
92
  DATA_KEYS.each_pair do |key, default_key|
97
-
98
93
  describe "##{key}" do
99
-
100
94
  describe "from single source" do
101
-
102
95
  it "returns empty hash if no common #{key} hash is provided" do
103
96
  DataMunger.new(
104
97
  {},
@@ -109,7 +102,7 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
109
102
  it "drops common #{key} if hash is nil" do
110
103
  DataMunger.new(
111
104
  {
112
- key => nil
105
+ key => nil,
113
106
  },
114
107
  {}
115
108
  ).public_send("#{key}_data_for", "suite", "plat").must_equal({})
@@ -118,10 +111,8 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
118
111
  it "returns kitchen config #{key} name" do
119
112
  DataMunger.new(
120
113
  {},
121
- {
122
- :defaults => {
123
- key => "thenoseknows"
124
- }
114
+ defaults: {
115
+ key => "thenoseknows",
125
116
  }
126
117
  ).public_send("#{key}_data_for", "suite", "platform").must_equal(
127
118
  default_key => "thenoseknows"
@@ -131,10 +122,8 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
131
122
  it "returns kitchen config #{key} name from callable" do
132
123
  DataMunger.new(
133
124
  {},
134
- {
135
- :defaults => {
136
- key => ->(suite, platform) { "#{suite}++#{platform}" }
137
- }
125
+ defaults: {
126
+ key => ->(suite, platform) { "#{suite}++#{platform}" },
138
127
  }
139
128
  ).public_send("#{key}_data_for", "suite", "platform").must_equal(
140
129
  default_key => "suite++platform"
@@ -144,7 +133,7 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
144
133
  it "returns common #{key} name" do
145
134
  DataMunger.new(
146
135
  {
147
- key => "starship"
136
+ key => "starship",
148
137
  },
149
138
  {}
150
139
  ).public_send("#{key}_data_for", "suite", "platform").must_equal(
@@ -157,8 +146,8 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
157
146
  {
158
147
  key => {
159
148
  default_key => "starship",
160
- :speed => 42
161
- }
149
+ :speed => 42,
150
+ },
162
151
  },
163
152
  {}
164
153
  ).public_send("#{key}_data_for", "suite", "platform").must_equal(
@@ -170,9 +159,9 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
170
159
  it "returns empty hash if platform config doesn't have #{key} hash" do
171
160
  DataMunger.new(
172
161
  {
173
- :platforms => [
174
- { :name => "plat" }
175
- ]
162
+ platforms: [
163
+ { name: "plat" },
164
+ ],
176
165
  },
177
166
  {}
178
167
  ).public_send("#{key}_data_for", "suite", "plat").must_equal({})
@@ -181,12 +170,12 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
181
170
  it "drops platform #{key} if hash is nil" do
182
171
  DataMunger.new(
183
172
  {
184
- :platforms => [
173
+ platforms: [
185
174
  {
186
175
  :name => "plat",
187
- key => nil
188
- }
189
- ]
176
+ key => nil,
177
+ },
178
+ ],
190
179
  },
191
180
  {}
192
181
  ).public_send("#{key}_data_for", "suite", "plat").must_equal({})
@@ -195,12 +184,12 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
195
184
  it "returns platform #{key} name" do
196
185
  DataMunger.new(
197
186
  {
198
- :platforms => [
187
+ platforms: [
199
188
  {
200
189
  :name => "plat",
201
- key => "flip"
202
- }
203
- ]
190
+ key => "flip",
191
+ },
192
+ ],
204
193
  },
205
194
  {}
206
195
  ).public_send("#{key}_data_for", "suite", "plat").must_equal(
@@ -211,15 +200,15 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
211
200
  it "returns platform config containing #{key} hash" do
212
201
  DataMunger.new(
213
202
  {
214
- :platforms => [
203
+ platforms: [
215
204
  {
216
205
  :name => "plat",
217
206
  key => {
218
207
  default_key => "flip",
219
- :flop => "yep"
220
- }
221
- }
222
- ]
208
+ :flop => "yep",
209
+ },
210
+ },
211
+ ],
223
212
  },
224
213
  {}
225
214
  ).public_send("#{key}_data_for", "suite", "plat").must_equal(
@@ -231,9 +220,9 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
231
220
  it "returns empty hash if suite config doesn't have #{key} hash" do
232
221
  DataMunger.new(
233
222
  {
234
- :suites => [
235
- { :name => "sweet" }
236
- ]
223
+ suites: [
224
+ { name: "sweet" },
225
+ ],
237
226
  },
238
227
  {}
239
228
  ).public_send("#{key}_data_for", "sweet", "platform").must_equal({})
@@ -242,12 +231,12 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
242
231
  it "drops suite #{key} hash is nil" do
243
232
  DataMunger.new(
244
233
  {
245
- :suites => [
234
+ suites: [
246
235
  {
247
236
  :name => "suite",
248
- key => nil
249
- }
250
- ]
237
+ key => nil,
238
+ },
239
+ ],
251
240
  },
252
241
  {}
253
242
  ).public_send("#{key}_data_for", "suite", "plat").must_equal({})
@@ -256,12 +245,12 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
256
245
  it "returns suite #{key} name" do
257
246
  DataMunger.new(
258
247
  {
259
- :suites => [
248
+ suites: [
260
249
  {
261
250
  :name => "sweet",
262
- key => "waz"
263
- }
264
- ]
251
+ key => "waz",
252
+ },
253
+ ],
265
254
  },
266
255
  {}
267
256
  ).public_send("#{key}_data_for", "sweet", "platform").must_equal(
@@ -272,15 +261,15 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
272
261
  it "returns suite config containing #{key} hash" do
273
262
  DataMunger.new(
274
263
  {
275
- :suites => [
264
+ suites: [
276
265
  {
277
266
  :name => "sweet",
278
267
  key => {
279
268
  default_key => "waz",
280
- :up => "nope"
281
- }
282
- }
283
- ]
269
+ :up => "nope",
270
+ },
271
+ },
272
+ ],
284
273
  },
285
274
  {}
286
275
  ).public_send("#{key}_data_for", "sweet", "platform").must_equal(
@@ -291,15 +280,14 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
291
280
  end
292
281
 
293
282
  describe "from multiple sources merging" do
294
-
295
283
  it "suite into platform into common" do
296
284
  DataMunger.new(
297
285
  {
298
286
  key => {
299
287
  default_key => "commony",
300
288
  :color => "purple",
301
- :fruit => %w[apple pear],
302
- :deep => { :common => "junk" }
289
+ :fruit => %w{apple pear},
290
+ :deep => { common: "junk" },
303
291
  },
304
292
  :platforms => [
305
293
  {
@@ -307,9 +295,9 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
307
295
  key => {
308
296
  default_key => "platformy",
309
297
  :fruit => ["banana"],
310
- :deep => { :platform => "stuff" }
311
- }
312
- }
298
+ :deep => { platform: "stuff" },
299
+ },
300
+ },
313
301
  ],
314
302
  :suites => [
315
303
  {
@@ -317,10 +305,10 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
317
305
  key => {
318
306
  default_key => "suitey",
319
307
  :vehicle => "car",
320
- :deep => { :suite => "things" }
321
- }
322
- }
323
- ]
308
+ :deep => { suite: "things" },
309
+ },
310
+ },
311
+ ],
324
312
  },
325
313
  {}
326
314
  ).public_send("#{key}_data_for", "sweet", "plat").must_equal(
@@ -329,9 +317,9 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
329
317
  :fruit => ["banana"],
330
318
  :vehicle => "car",
331
319
  :deep => {
332
- :common => "junk",
333
- :platform => "stuff",
334
- :suite => "things"
320
+ common: "junk",
321
+ platform: "stuff",
322
+ suite: "things",
335
323
  }
336
324
  )
337
325
  end
@@ -342,8 +330,8 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
342
330
  key => {
343
331
  default_key => "commony",
344
332
  :color => "purple",
345
- :fruit => %w[apple pear],
346
- :deep => { :common => "junk" }
333
+ :fruit => %w{apple pear},
334
+ :deep => { common: "junk" },
347
335
  },
348
336
  :platforms => [
349
337
  {
@@ -351,10 +339,10 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
351
339
  key => {
352
340
  default_key => "platformy",
353
341
  :fruit => ["banana"],
354
- :deep => { :platform => "stuff" }
355
- }
356
- }
357
- ]
342
+ :deep => { platform: "stuff" },
343
+ },
344
+ },
345
+ ],
358
346
  },
359
347
  {}
360
348
  ).public_send("#{key}_data_for", "sweet", "plat").must_equal(
@@ -362,8 +350,8 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
362
350
  :color => "purple",
363
351
  :fruit => ["banana"],
364
352
  :deep => {
365
- :common => "junk",
366
- :platform => "stuff"
353
+ common: "junk",
354
+ platform: "stuff",
367
355
  }
368
356
  )
369
357
  end
@@ -374,8 +362,8 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
374
362
  key => {
375
363
  default_key => "commony",
376
364
  :color => "purple",
377
- :fruit => %w[apple pear],
378
- :deep => { :common => "junk" }
365
+ :fruit => %w{apple pear},
366
+ :deep => { common: "junk" },
379
367
  },
380
368
  :suites => [
381
369
  {
@@ -383,20 +371,20 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
383
371
  key => {
384
372
  default_key => "suitey",
385
373
  :vehicle => "car",
386
- :deep => { :suite => "things" }
387
- }
388
- }
389
- ]
374
+ :deep => { suite: "things" },
375
+ },
376
+ },
377
+ ],
390
378
  },
391
379
  {}
392
380
  ).public_send("#{key}_data_for", "sweet", "plat").must_equal(
393
381
  default_key => "suitey",
394
382
  :color => "purple",
395
- :fruit => %w[apple pear],
383
+ :fruit => %w{apple pear},
396
384
  :vehicle => "car",
397
385
  :deep => {
398
- :common => "junk",
399
- :suite => "things"
386
+ common: "junk",
387
+ suite: "things",
400
388
  }
401
389
  )
402
390
  end
@@ -404,26 +392,26 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
404
392
  it "suite into platform" do
405
393
  DataMunger.new(
406
394
  {
407
- :platforms => [
395
+ platforms: [
408
396
  {
409
397
  :name => "plat",
410
398
  key => {
411
399
  default_key => "platformy",
412
400
  :fruit => ["banana"],
413
- :deep => { :platform => "stuff" }
414
- }
415
- }
401
+ :deep => { platform: "stuff" },
402
+ },
403
+ },
416
404
  ],
417
- :suites => [
405
+ suites: [
418
406
  {
419
407
  :name => "sweet",
420
408
  key => {
421
409
  default_key => "suitey",
422
410
  :vehicle => "car",
423
- :deep => { :suite => "things" }
424
- }
425
- }
426
- ]
411
+ :deep => { suite: "things" },
412
+ },
413
+ },
414
+ ],
427
415
  },
428
416
  {}
429
417
  ).public_send("#{key}_data_for", "sweet", "plat").must_equal(
@@ -431,8 +419,8 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
431
419
  :fruit => ["banana"],
432
420
  :vehicle => "car",
433
421
  :deep => {
434
- :platform => "stuff",
435
- :suite => "things"
422
+ platform: "stuff",
423
+ suite: "things",
436
424
  }
437
425
  )
438
426
  end
@@ -441,367 +429,363 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
441
429
  end
442
430
 
443
431
  describe "primary Chef data" do
444
-
445
432
  describe "in a suite" do
446
-
447
433
  it "moves attributes into provisioner" do
448
434
  DataMunger.new(
449
435
  {
450
- :provisioner => "chefy",
451
- :suites => [
436
+ provisioner: "chefy",
437
+ suites: [
452
438
  {
453
- :name => "sweet",
454
- :attributes => { :one => "two" }
455
- }
456
- ]
439
+ name: "sweet",
440
+ attributes: { one: "two" },
441
+ },
442
+ ],
457
443
  },
458
444
  {}
459
445
  ).provisioner_data_for("sweet", "plat").must_equal(
460
- :name => "chefy",
461
- :attributes => { :one => "two" }
446
+ name: "chefy",
447
+ attributes: { one: "two" }
462
448
  )
463
449
  end
464
450
 
465
451
  it "moves run_list into provisioner" do
466
452
  DataMunger.new(
467
453
  {
468
- :provisioner => "chefy",
469
- :suites => [
454
+ provisioner: "chefy",
455
+ suites: [
470
456
  {
471
- :name => "sweet",
472
- :run_list => %w[one two]
473
- }
474
- ]
457
+ name: "sweet",
458
+ run_list: %w{one two},
459
+ },
460
+ ],
475
461
  },
476
462
  {}
477
463
  ).provisioner_data_for("sweet", "plat").must_equal(
478
- :name => "chefy",
479
- :run_list => %w[one two]
464
+ name: "chefy",
465
+ run_list: %w{one two}
480
466
  )
481
467
  end
482
468
 
483
469
  it "moves named_run_list into provisioner" do
484
470
  DataMunger.new(
485
471
  {
486
- :provisioner => "chefy",
487
- :suites => [
472
+ provisioner: "chefy",
473
+ suites: [
488
474
  {
489
- :name => "sweet",
490
- :named_run_list => "other_run_list"
491
- }
492
- ]
475
+ name: "sweet",
476
+ named_run_list: "other_run_list",
477
+ },
478
+ ],
493
479
  },
494
480
  {}
495
481
  ).provisioner_data_for("sweet", "plat").must_equal(
496
- :name => "chefy",
497
- :named_run_list => "other_run_list"
482
+ name: "chefy",
483
+ named_run_list: "other_run_list"
498
484
  )
499
485
  end
500
486
  it "maintains run_list in provisioner" do
501
487
  DataMunger.new(
502
488
  {
503
- :provisioner => "chefy",
504
- :suites => [
489
+ provisioner: "chefy",
490
+ suites: [
505
491
  {
506
- :name => "sweet",
507
- :provisioner => {
508
- :run_list => %w[one two]
509
- }
510
- }
511
- ]
492
+ name: "sweet",
493
+ provisioner: {
494
+ run_list: %w{one two},
495
+ },
496
+ },
497
+ ],
512
498
  },
513
499
  {}
514
500
  ).provisioner_data_for("sweet", "plat").must_equal(
515
- :name => "chefy",
516
- :run_list => %w[one two]
501
+ name: "chefy",
502
+ run_list: %w{one two}
517
503
  )
518
504
  end
519
505
 
520
506
  it "merge provisioner into attributes if provisioner exists" do
521
507
  DataMunger.new(
522
508
  {
523
- :suites => [
509
+ suites: [
524
510
  {
525
- :name => "sweet",
526
- :attributes => { :one => "two" },
527
- :provisioner => "chefy"
528
- }
529
- ]
511
+ name: "sweet",
512
+ attributes: { one: "two" },
513
+ provisioner: "chefy",
514
+ },
515
+ ],
530
516
  },
531
517
  {}
532
518
  ).provisioner_data_for("sweet", "plat").must_equal(
533
- :name => "chefy",
534
- :attributes => { :one => "two" }
519
+ name: "chefy",
520
+ attributes: { one: "two" }
535
521
  )
536
522
  end
537
523
 
538
524
  it "merge provisioner into run_list if provisioner exists" do
539
525
  DataMunger.new(
540
526
  {
541
- :suites => [
527
+ suites: [
542
528
  {
543
- :name => "sweet",
544
- :run_list => %w[one two],
545
- :provisioner => "chefy"
546
- }
547
- ]
529
+ name: "sweet",
530
+ run_list: %w{one two},
531
+ provisioner: "chefy",
532
+ },
533
+ ],
548
534
  },
549
535
  {}
550
536
  ).provisioner_data_for("sweet", "plat").must_equal(
551
- :name => "chefy",
552
- :run_list => %w[one two]
537
+ name: "chefy",
538
+ run_list: %w{one two}
553
539
  )
554
540
  end
555
541
 
556
542
  it "merge provisioner into named_run_list if provisioner exists" do
557
543
  DataMunger.new(
558
544
  {
559
- :suites => [
545
+ suites: [
560
546
  {
561
- :name => "sweet",
562
- :named_run_list => "other_run_list",
563
- :provisioner => "chefy"
564
- }
565
- ]
547
+ name: "sweet",
548
+ named_run_list: "other_run_list",
549
+ provisioner: "chefy",
550
+ },
551
+ ],
566
552
  },
567
553
  {}
568
554
  ).provisioner_data_for("sweet", "plat").must_equal(
569
- :name => "chefy",
570
- :named_run_list => "other_run_list"
555
+ name: "chefy",
556
+ named_run_list: "other_run_list"
571
557
  )
572
558
  end
573
559
  it "drops nil run_list" do
574
560
  DataMunger.new(
575
561
  {
576
- :suites => [
562
+ suites: [
577
563
  {
578
- :name => "sweet",
579
- :run_list => nil,
580
- :provisioner => "chefy"
581
- }
582
- ]
564
+ name: "sweet",
565
+ run_list: nil,
566
+ provisioner: "chefy",
567
+ },
568
+ ],
583
569
  },
584
570
  {}
585
571
  ).provisioner_data_for("sweet", "plat").must_equal(
586
- :name => "chefy"
572
+ name: "chefy"
587
573
  )
588
574
  end
589
575
 
590
576
  it "drops nil attributes" do
591
577
  DataMunger.new(
592
578
  {
593
- :suites => [
579
+ suites: [
594
580
  {
595
- :name => "sweet",
596
- :attributes => nil,
597
- :provisioner => "chefy"
598
- }
599
- ]
581
+ name: "sweet",
582
+ attributes: nil,
583
+ provisioner: "chefy",
584
+ },
585
+ ],
600
586
  },
601
587
  {}
602
588
  ).provisioner_data_for("sweet", "plat").must_equal(
603
- :name => "chefy"
589
+ name: "chefy"
604
590
  )
605
591
  end
606
592
  end
607
593
 
608
594
  describe "in a platform" do
609
-
610
595
  it "moves attributes into provisioner" do
611
596
  DataMunger.new(
612
597
  {
613
- :provisioner => "chefy",
614
- :platforms => [
598
+ provisioner: "chefy",
599
+ platforms: [
615
600
  {
616
- :name => "plat",
617
- :attributes => { :one => "two" }
618
- }
619
- ]
601
+ name: "plat",
602
+ attributes: { one: "two" },
603
+ },
604
+ ],
620
605
  },
621
606
  {}
622
607
  ).provisioner_data_for("sweet", "plat").must_equal(
623
- :name => "chefy",
624
- :attributes => { :one => "two" }
608
+ name: "chefy",
609
+ attributes: { one: "two" }
625
610
  )
626
611
  end
627
612
 
628
613
  it "moves run_list into provisioner" do
629
614
  DataMunger.new(
630
615
  {
631
- :provisioner => "chefy",
632
- :platforms => [
616
+ provisioner: "chefy",
617
+ platforms: [
633
618
  {
634
- :name => "plat",
635
- :run_list => %w[one two]
636
- }
637
- ]
619
+ name: "plat",
620
+ run_list: %w{one two},
621
+ },
622
+ ],
638
623
  },
639
624
  {}
640
625
  ).provisioner_data_for("sweet", "plat").must_equal(
641
- :name => "chefy",
642
- :run_list => %w[one two]
626
+ name: "chefy",
627
+ run_list: %w{one two}
643
628
  )
644
629
  end
645
630
 
646
631
  it "moves named_run_list into provisioner" do
647
632
  DataMunger.new(
648
633
  {
649
- :provisioner => "chefy",
650
- :platforms => [
634
+ provisioner: "chefy",
635
+ platforms: [
651
636
  {
652
- :name => "plat",
653
- :named_run_list => "other_run_list"
654
- }
655
- ]
637
+ name: "plat",
638
+ named_run_list: "other_run_list",
639
+ },
640
+ ],
656
641
  },
657
642
  {}
658
643
  ).provisioner_data_for("sweet", "plat").must_equal(
659
- :name => "chefy",
660
- :named_run_list => "other_run_list"
644
+ name: "chefy",
645
+ named_run_list: "other_run_list"
661
646
  )
662
647
  end
663
648
  it "maintains run_list in provisioner" do
664
649
  DataMunger.new(
665
650
  {
666
- :provisioner => "chefy",
667
- :platforms => [
651
+ provisioner: "chefy",
652
+ platforms: [
668
653
  {
669
- :name => "plat",
670
- :provisioner => {
671
- :run_list => %w[one two]
672
- }
673
- }
674
- ]
654
+ name: "plat",
655
+ provisioner: {
656
+ run_list: %w{one two},
657
+ },
658
+ },
659
+ ],
675
660
  },
676
661
  {}
677
662
  ).provisioner_data_for("sweet", "plat").must_equal(
678
- :name => "chefy",
679
- :run_list => %w[one two]
663
+ name: "chefy",
664
+ run_list: %w{one two}
680
665
  )
681
666
  end
682
667
 
683
668
  it "merge provisioner into attributes if provisioner exists" do
684
669
  DataMunger.new(
685
670
  {
686
- :platforms => [
671
+ platforms: [
687
672
  {
688
- :name => "plat",
689
- :attributes => { :one => "two" },
690
- :provisioner => "chefy"
691
- }
692
- ]
673
+ name: "plat",
674
+ attributes: { one: "two" },
675
+ provisioner: "chefy",
676
+ },
677
+ ],
693
678
  },
694
679
  {}
695
680
  ).provisioner_data_for("sweet", "plat").must_equal(
696
- :name => "chefy",
697
- :attributes => { :one => "two" }
681
+ name: "chefy",
682
+ attributes: { one: "two" }
698
683
  )
699
684
  end
700
685
 
701
686
  it "merge provisioner into run_list if provisioner exists" do
702
687
  DataMunger.new(
703
688
  {
704
- :platforms => [
689
+ platforms: [
705
690
  {
706
- :name => "plat",
707
- :run_list => %w[one two],
708
- :provisioner => "chefy"
709
- }
710
- ]
691
+ name: "plat",
692
+ run_list: %w{one two},
693
+ provisioner: "chefy",
694
+ },
695
+ ],
711
696
  },
712
697
  {}
713
698
  ).provisioner_data_for("sweet", "plat").must_equal(
714
- :name => "chefy",
715
- :run_list => %w[one two]
699
+ name: "chefy",
700
+ run_list: %w{one two}
716
701
  )
717
702
  end
718
703
 
719
704
  it "merge provisioner into named_run_list if provisioner exists" do
720
705
  DataMunger.new(
721
706
  {
722
- :platforms => [
707
+ platforms: [
723
708
  {
724
- :name => "plat",
725
- :named_run_list => "other_run_list",
726
- :provisioner => "chefy"
727
- }
728
- ]
709
+ name: "plat",
710
+ named_run_list: "other_run_list",
711
+ provisioner: "chefy",
712
+ },
713
+ ],
729
714
  },
730
715
  {}
731
716
  ).provisioner_data_for("sweet", "plat").must_equal(
732
- :name => "chefy",
733
- :named_run_list => "other_run_list"
717
+ name: "chefy",
718
+ named_run_list: "other_run_list"
734
719
  )
735
720
  end
736
721
  it "drops nil run_list" do
737
722
  DataMunger.new(
738
723
  {
739
- :platforms => [
724
+ platforms: [
740
725
  {
741
- :name => "plat",
742
- :run_list => nil,
743
- :provisioner => "chefy"
744
- }
745
- ]
726
+ name: "plat",
727
+ run_list: nil,
728
+ provisioner: "chefy",
729
+ },
730
+ ],
746
731
  },
747
732
  {}
748
733
  ).provisioner_data_for("sweet", "plat").must_equal(
749
- :name => "chefy"
734
+ name: "chefy"
750
735
  )
751
736
  end
752
737
 
753
738
  it "drops nil attributes" do
754
739
  DataMunger.new(
755
740
  {
756
- :platforms => [
741
+ platforms: [
757
742
  {
758
- :name => "plat",
759
- :attributes => nil,
760
- :provisioner => "chefy"
761
- }
762
- ]
743
+ name: "plat",
744
+ attributes: nil,
745
+ provisioner: "chefy",
746
+ },
747
+ ],
763
748
  },
764
749
  {}
765
750
  ).provisioner_data_for("sweet", "plat").must_equal(
766
- :name => "chefy"
751
+ name: "chefy"
767
752
  )
768
753
  end
769
754
  end
770
755
 
771
756
  describe "in a suite and platform" do
772
-
773
757
  it "merges suite attributes into platform attributes" do
774
758
  DataMunger.new(
775
759
  {
776
- :provisioner => "chefy",
777
- :platforms => [
760
+ provisioner: "chefy",
761
+ platforms: [
778
762
  {
779
- :name => "plat",
780
- :attributes => {
781
- :color => "blue",
782
- :deep => { :platform => "much" }
783
- }
784
- }
763
+ name: "plat",
764
+ attributes: {
765
+ color: "blue",
766
+ deep: { platform: "much" },
767
+ },
768
+ },
785
769
  ],
786
- :suites => [
770
+ suites: [
787
771
  {
788
- :name => "sweet",
789
- :attributes => {
790
- :color => "pink",
791
- :deep => { :suite => "wow" }
792
- }
793
- }
794
- ]
772
+ name: "sweet",
773
+ attributes: {
774
+ color: "pink",
775
+ deep: { suite: "wow" },
776
+ },
777
+ },
778
+ ],
795
779
  },
796
780
  {}
797
781
  ).provisioner_data_for("sweet", "plat").must_equal(
798
- :name => "chefy",
799
- :attributes => {
800
- :color => "pink",
801
- :deep => {
802
- :suite => "wow",
803
- :platform => "much"
804
- }
782
+ name: "chefy",
783
+ attributes: {
784
+ color: "pink",
785
+ deep: {
786
+ suite: "wow",
787
+ platform: "much",
788
+ },
805
789
  }
806
790
  )
807
791
  end
@@ -809,130 +793,130 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
809
793
  it "concats suite run_list to platform run_list" do
810
794
  DataMunger.new(
811
795
  {
812
- :provisioner => "chefy",
813
- :platforms => [
796
+ provisioner: "chefy",
797
+ platforms: [
814
798
  {
815
- :name => "plat",
816
- :run_list => %w[one two]
817
- }
799
+ name: "plat",
800
+ run_list: %w{one two},
801
+ },
818
802
  ],
819
- :suites => [
803
+ suites: [
820
804
  {
821
- :name => "sweet",
822
- :run_list => %w[three four]
823
- }
824
- ]
805
+ name: "sweet",
806
+ run_list: %w{three four},
807
+ },
808
+ ],
825
809
  },
826
810
  {}
827
811
  ).provisioner_data_for("sweet", "plat").must_equal(
828
- :name => "chefy",
829
- :run_list => %w[one two three four]
812
+ name: "chefy",
813
+ run_list: %w{one two three four}
830
814
  )
831
815
  end
832
816
 
833
817
  it "concats suite run_list in provisioner to platform run_list" do
834
818
  DataMunger.new(
835
819
  {
836
- :provisioner => "chefy",
837
- :platforms => [
820
+ provisioner: "chefy",
821
+ platforms: [
838
822
  {
839
- :name => "plat",
840
- :run_list => %w[one two]
841
- }
823
+ name: "plat",
824
+ run_list: %w{one two},
825
+ },
842
826
  ],
843
- :suites => [
827
+ suites: [
844
828
  {
845
- :name => "sweet",
846
- :provisioner => {
847
- :run_list => %w[three four]
848
- }
849
- }
850
- ]
829
+ name: "sweet",
830
+ provisioner: {
831
+ run_list: %w{three four},
832
+ },
833
+ },
834
+ ],
851
835
  },
852
836
  {}
853
837
  ).provisioner_data_for("sweet", "plat").must_equal(
854
- :name => "chefy",
855
- :run_list => %w[one two three four]
838
+ name: "chefy",
839
+ run_list: %w{one two three four}
856
840
  )
857
841
  end
858
842
 
859
843
  it "concats suite run_list to platform run_list in provisioner" do
860
844
  DataMunger.new(
861
845
  {
862
- :provisioner => "chefy",
863
- :platforms => [
846
+ provisioner: "chefy",
847
+ platforms: [
864
848
  {
865
- :name => "plat",
866
- :provisioner => {
867
- :run_list => %w[one two]
868
- }
869
- }
849
+ name: "plat",
850
+ provisioner: {
851
+ run_list: %w{one two},
852
+ },
853
+ },
870
854
  ],
871
- :suites => [
855
+ suites: [
872
856
  {
873
- :name => "sweet",
874
- :run_list => %w[three four]
875
- }
876
- ]
857
+ name: "sweet",
858
+ run_list: %w{three four},
859
+ },
860
+ ],
877
861
  },
878
862
  {}
879
863
  ).provisioner_data_for("sweet", "plat").must_equal(
880
- :name => "chefy",
881
- :run_list => %w[one two three four]
864
+ name: "chefy",
865
+ run_list: %w{one two three four}
882
866
  )
883
867
  end
884
868
 
885
869
  it "concats to nil run_lists into an empty Array" do
886
870
  DataMunger.new(
887
871
  {
888
- :provisioner => "chefy",
889
- :platforms => [
872
+ provisioner: "chefy",
873
+ platforms: [
890
874
  {
891
- :name => "plat",
892
- :provisioner => {
893
- :run_list => nil
894
- }
895
- }
875
+ name: "plat",
876
+ provisioner: {
877
+ run_list: nil,
878
+ },
879
+ },
896
880
  ],
897
- :suites => [
881
+ suites: [
898
882
  {
899
- :name => "sweet",
900
- :run_list => nil
901
- }
902
- ]
883
+ name: "sweet",
884
+ run_list: nil,
885
+ },
886
+ ],
903
887
  },
904
888
  {}
905
889
  ).provisioner_data_for("sweet", "plat").must_equal(
906
- :name => "chefy",
907
- :run_list => []
890
+ name: "chefy",
891
+ run_list: []
908
892
  )
909
893
  end
910
894
 
911
895
  it "does not corrupt run_list data for multiple suite/platform pairs" do
912
896
  munger = DataMunger.new(
913
897
  {
914
- :provisioner => "chefy",
915
- :platforms => [
898
+ provisioner: "chefy",
899
+ platforms: [
916
900
  {
917
- :name => "p1"
901
+ name: "p1",
918
902
  },
919
903
  {
920
- :name => "p2",
921
- :run_list => %w[one two]
922
- }
904
+ name: "p2",
905
+ run_list: %w{one two},
906
+ },
923
907
  ],
924
- :suites => [
908
+ suites: [
925
909
  {
926
- :name => "s1",
927
- :run_list => %w[alpha beta]
910
+ name: "s1",
911
+ run_list: %w{alpha beta},
928
912
  },
929
913
  {
930
- :name => "s2",
931
- :provisioner => {
932
- :run_list => %w[three four]
933
- }
934
- }
935
- ]
914
+ name: "s2",
915
+ provisioner: {
916
+ run_list: %w{three four},
917
+ },
918
+ },
919
+ ],
936
920
  },
937
921
  {}
938
922
  )
@@ -944,35 +928,29 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
944
928
  munger.provisioner_data_for("s2", "p1")
945
929
 
946
930
  munger.provisioner_data_for("s2", "p2").must_equal(
947
- :name => "chefy",
948
- :run_list => %w[one two three four]
931
+ name: "chefy",
932
+ run_list: %w{one two three four}
949
933
  )
950
934
  end
951
935
  end
952
936
  end
953
937
 
954
938
  describe "kitchen config" do
955
-
956
939
  [:kitchen_root, :test_base_path].each do |key|
957
-
958
940
  describe "for #{key}" do
959
-
960
941
  describe "for #driver_data_for" do
961
-
962
942
  it "is returned when provided" do
963
943
  DataMunger.new(
964
944
  {
965
- :driver => "chefy",
966
- :platforms => [
967
- { :name => "plat" }
945
+ driver: "chefy",
946
+ platforms: [
947
+ { name: "plat" },
948
+ ],
949
+ suites: [
950
+ { name: "sweet" },
968
951
  ],
969
- :suites => [
970
- { :name => "sweet" }
971
- ]
972
952
  },
973
- {
974
- key => "datvalue"
975
- }
953
+ key => "datvalue"
976
954
  ).driver_data_for("sweet", "plat").must_equal(
977
955
  :name => "chefy",
978
956
  key => "datvalue"
@@ -982,16 +960,16 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
982
960
  it "is returned when provided in user data" do
983
961
  DataMunger.new(
984
962
  {
985
- :kitchen => {
986
- key => "datvalue"
963
+ kitchen: {
964
+ key => "datvalue",
987
965
  },
988
- :driver => "chefy",
989
- :platforms => [
990
- { :name => "plat" }
966
+ driver: "chefy",
967
+ platforms: [
968
+ { name: "plat" },
969
+ ],
970
+ suites: [
971
+ { name: "sweet" },
991
972
  ],
992
- :suites => [
993
- { :name => "sweet" }
994
- ]
995
973
  },
996
974
  {}
997
975
  ).driver_data_for("sweet", "plat").must_equal(
@@ -1003,20 +981,18 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1003
981
  it "user data value beats provided value" do
1004
982
  DataMunger.new(
1005
983
  {
1006
- :kitchen => {
1007
- key => "datvalue"
984
+ kitchen: {
985
+ key => "datvalue",
1008
986
  },
1009
- :driver => "chefy",
1010
- :platforms => [
1011
- { :name => "plat" }
987
+ driver: "chefy",
988
+ platforms: [
989
+ { name: "plat" },
990
+ ],
991
+ suites: [
992
+ { name: "sweet" },
1012
993
  ],
1013
- :suites => [
1014
- { :name => "sweet" }
1015
- ]
1016
994
  },
1017
- {
1018
- key => "ilose"
1019
- }
995
+ key => "ilose"
1020
996
  ).driver_data_for("sweet", "plat").must_equal(
1021
997
  :name => "chefy",
1022
998
  key => "datvalue"
@@ -1026,40 +1002,37 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1026
1002
  it "rejects any value in driver data" do
1027
1003
  DataMunger.new(
1028
1004
  {
1029
- :driver => {
1005
+ driver: {
1030
1006
  :name => "chefy",
1031
- key => "imevil"
1007
+ key => "imevil",
1032
1008
  },
1033
- :platforms => [
1034
- { :name => "plat" }
1009
+ platforms: [
1010
+ { name: "plat" },
1011
+ ],
1012
+ suites: [
1013
+ { name: "sweet" },
1035
1014
  ],
1036
- :suites => [
1037
- { :name => "sweet" }
1038
- ]
1039
1015
  },
1040
1016
  {}
1041
1017
  ).driver_data_for("sweet", "plat").must_equal(
1042
- :name => "chefy"
1018
+ name: "chefy"
1043
1019
  )
1044
1020
  end
1045
1021
  end
1046
1022
 
1047
1023
  describe "for #provisioner_data_for" do
1048
-
1049
1024
  it "is returned when provided" do
1050
1025
  DataMunger.new(
1051
1026
  {
1052
- :provisioner => "chefy",
1053
- :platforms => [
1054
- { :name => "plat" }
1027
+ provisioner: "chefy",
1028
+ platforms: [
1029
+ { name: "plat" },
1030
+ ],
1031
+ suites: [
1032
+ { name: "sweet" },
1055
1033
  ],
1056
- :suites => [
1057
- { :name => "sweet" }
1058
- ]
1059
1034
  },
1060
- {
1061
- key => "datvalue"
1062
- }
1035
+ key => "datvalue"
1063
1036
  ).provisioner_data_for("sweet", "plat").must_equal(
1064
1037
  :name => "chefy",
1065
1038
  key => "datvalue"
@@ -1069,16 +1042,16 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1069
1042
  it "is returned when provided in user data" do
1070
1043
  DataMunger.new(
1071
1044
  {
1072
- :kitchen => {
1073
- key => "datvalue"
1045
+ kitchen: {
1046
+ key => "datvalue",
1074
1047
  },
1075
- :provisioner => "chefy",
1076
- :platforms => [
1077
- { :name => "plat" }
1048
+ provisioner: "chefy",
1049
+ platforms: [
1050
+ { name: "plat" },
1051
+ ],
1052
+ suites: [
1053
+ { name: "sweet" },
1078
1054
  ],
1079
- :suites => [
1080
- { :name => "sweet" }
1081
- ]
1082
1055
  },
1083
1056
  {}
1084
1057
  ).provisioner_data_for("sweet", "plat").must_equal(
@@ -1090,20 +1063,18 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1090
1063
  it "user data value beats provided value" do
1091
1064
  DataMunger.new(
1092
1065
  {
1093
- :kitchen => {
1094
- key => "datvalue"
1066
+ kitchen: {
1067
+ key => "datvalue",
1095
1068
  },
1096
- :provisioner => "chefy",
1097
- :platforms => [
1098
- { :name => "plat" }
1069
+ provisioner: "chefy",
1070
+ platforms: [
1071
+ { name: "plat" },
1072
+ ],
1073
+ suites: [
1074
+ { name: "sweet" },
1099
1075
  ],
1100
- :suites => [
1101
- { :name => "sweet" }
1102
- ]
1103
1076
  },
1104
- {
1105
- key => "ilose"
1106
- }
1077
+ key => "ilose"
1107
1078
  ).provisioner_data_for("sweet", "plat").must_equal(
1108
1079
  :name => "chefy",
1109
1080
  key => "datvalue"
@@ -1113,40 +1084,37 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1113
1084
  it "rejects any value in provisioner data" do
1114
1085
  DataMunger.new(
1115
1086
  {
1116
- :provisioner => {
1087
+ provisioner: {
1117
1088
  :name => "chefy",
1118
- key => "imevil"
1089
+ key => "imevil",
1119
1090
  },
1120
- :platforms => [
1121
- { :name => "plat" }
1091
+ platforms: [
1092
+ { name: "plat" },
1093
+ ],
1094
+ suites: [
1095
+ { name: "sweet" },
1122
1096
  ],
1123
- :suites => [
1124
- { :name => "sweet" }
1125
- ]
1126
1097
  },
1127
1098
  {}
1128
1099
  ).provisioner_data_for("sweet", "plat").must_equal(
1129
- :name => "chefy"
1100
+ name: "chefy"
1130
1101
  )
1131
1102
  end
1132
1103
  end
1133
1104
 
1134
1105
  describe "for #verifier_data_for" do
1135
-
1136
1106
  it "is returned when provided" do
1137
1107
  DataMunger.new(
1138
1108
  {
1139
- :verifier => "chefy",
1140
- :platforms => [
1141
- { :name => "plat" }
1109
+ verifier: "chefy",
1110
+ platforms: [
1111
+ { name: "plat" },
1112
+ ],
1113
+ suites: [
1114
+ { name: "sweet" },
1142
1115
  ],
1143
- :suites => [
1144
- { :name => "sweet" }
1145
- ]
1146
1116
  },
1147
- {
1148
- key => "datvalue"
1149
- }
1117
+ key => "datvalue"
1150
1118
  ).verifier_data_for("sweet", "plat").must_equal(
1151
1119
  :name => "chefy",
1152
1120
  key => "datvalue"
@@ -1156,16 +1124,16 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1156
1124
  it "is returned when provided in user data" do
1157
1125
  DataMunger.new(
1158
1126
  {
1159
- :kitchen => {
1160
- key => "datvalue"
1127
+ kitchen: {
1128
+ key => "datvalue",
1161
1129
  },
1162
- :verifier => "chefy",
1163
- :platforms => [
1164
- { :name => "plat" }
1130
+ verifier: "chefy",
1131
+ platforms: [
1132
+ { name: "plat" },
1133
+ ],
1134
+ suites: [
1135
+ { name: "sweet" },
1165
1136
  ],
1166
- :suites => [
1167
- { :name => "sweet" }
1168
- ]
1169
1137
  },
1170
1138
  {}
1171
1139
  ).verifier_data_for("sweet", "plat").must_equal(
@@ -1177,20 +1145,18 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1177
1145
  it "user data value beats provided value" do
1178
1146
  DataMunger.new(
1179
1147
  {
1180
- :kitchen => {
1181
- key => "datvalue"
1148
+ kitchen: {
1149
+ key => "datvalue",
1182
1150
  },
1183
- :verifier => "chefy",
1184
- :platforms => [
1185
- { :name => "plat" }
1151
+ verifier: "chefy",
1152
+ platforms: [
1153
+ { name: "plat" },
1154
+ ],
1155
+ suites: [
1156
+ { name: "sweet" },
1186
1157
  ],
1187
- :suites => [
1188
- { :name => "sweet" }
1189
- ]
1190
1158
  },
1191
- {
1192
- key => "ilose"
1193
- }
1159
+ key => "ilose"
1194
1160
  ).verifier_data_for("sweet", "plat").must_equal(
1195
1161
  :name => "chefy",
1196
1162
  key => "datvalue"
@@ -1200,40 +1166,37 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1200
1166
  it "rejects any value in verifier data" do
1201
1167
  DataMunger.new(
1202
1168
  {
1203
- :verifier => {
1169
+ verifier: {
1204
1170
  :version => "chefy",
1205
- key => "imevil"
1171
+ key => "imevil",
1206
1172
  },
1207
- :platforms => [
1208
- { :name => "plat" }
1173
+ platforms: [
1174
+ { name: "plat" },
1175
+ ],
1176
+ suites: [
1177
+ { name: "sweet" },
1209
1178
  ],
1210
- :suites => [
1211
- { :name => "sweet" }
1212
- ]
1213
1179
  },
1214
1180
  {}
1215
1181
  ).verifier_data_for("sweet", "plat").must_equal(
1216
- :version => "chefy"
1182
+ version: "chefy"
1217
1183
  )
1218
1184
  end
1219
1185
  end
1220
1186
 
1221
1187
  describe "for #transport_data_for" do
1222
-
1223
1188
  it "is returned when provided" do
1224
1189
  DataMunger.new(
1225
1190
  {
1226
- :transport => "pipes",
1227
- :platforms => [
1228
- { :name => "plat" }
1191
+ transport: "pipes",
1192
+ platforms: [
1193
+ { name: "plat" },
1194
+ ],
1195
+ suites: [
1196
+ { name: "sweet" },
1229
1197
  ],
1230
- :suites => [
1231
- { :name => "sweet" }
1232
- ]
1233
1198
  },
1234
- {
1235
- key => "datvalue"
1236
- }
1199
+ key => "datvalue"
1237
1200
  ).transport_data_for("sweet", "plat").must_equal(
1238
1201
  :name => "pipes",
1239
1202
  key => "datvalue"
@@ -1243,16 +1206,16 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1243
1206
  it "is returned when provided in user data" do
1244
1207
  DataMunger.new(
1245
1208
  {
1246
- :kitchen => {
1247
- key => "datvalue"
1209
+ kitchen: {
1210
+ key => "datvalue",
1248
1211
  },
1249
- :transport => "pipes",
1250
- :platforms => [
1251
- { :name => "plat" }
1212
+ transport: "pipes",
1213
+ platforms: [
1214
+ { name: "plat" },
1215
+ ],
1216
+ suites: [
1217
+ { name: "sweet" },
1252
1218
  ],
1253
- :suites => [
1254
- { :name => "sweet" }
1255
- ]
1256
1219
  },
1257
1220
  {}
1258
1221
  ).transport_data_for("sweet", "plat").must_equal(
@@ -1264,20 +1227,18 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1264
1227
  it "user data value beats provided value" do
1265
1228
  DataMunger.new(
1266
1229
  {
1267
- :kitchen => {
1268
- key => "datvalue"
1230
+ kitchen: {
1231
+ key => "datvalue",
1269
1232
  },
1270
- :transport => "pipes",
1271
- :platforms => [
1272
- { :name => "plat" }
1233
+ transport: "pipes",
1234
+ platforms: [
1235
+ { name: "plat" },
1236
+ ],
1237
+ suites: [
1238
+ { name: "sweet" },
1273
1239
  ],
1274
- :suites => [
1275
- { :name => "sweet" }
1276
- ]
1277
1240
  },
1278
- {
1279
- key => "ilose"
1280
- }
1241
+ key => "ilose"
1281
1242
  ).transport_data_for("sweet", "plat").must_equal(
1282
1243
  :name => "pipes",
1283
1244
  key => "datvalue"
@@ -1287,20 +1248,20 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1287
1248
  it "rejects any value in transport data" do
1288
1249
  DataMunger.new(
1289
1250
  {
1290
- :transport => {
1251
+ transport: {
1291
1252
  :name => "pipes",
1292
- key => "imevil"
1253
+ key => "imevil",
1293
1254
  },
1294
- :platforms => [
1295
- { :name => "plat" }
1255
+ platforms: [
1256
+ { name: "plat" },
1257
+ ],
1258
+ suites: [
1259
+ { name: "sweet" },
1296
1260
  ],
1297
- :suites => [
1298
- { :name => "sweet" }
1299
- ]
1300
1261
  },
1301
1262
  {}
1302
1263
  ).transport_data_for("sweet", "plat").must_equal(
1303
- :name => "pipes"
1264
+ name: "pipes"
1304
1265
  )
1305
1266
  end
1306
1267
  end
@@ -1308,25 +1269,20 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1308
1269
  end
1309
1270
 
1310
1271
  [:log_level].each do |key|
1311
-
1312
1272
  describe "for #{key}" do
1313
-
1314
1273
  describe "for #driver_data_for" do
1315
-
1316
1274
  it "is returned when provided" do
1317
1275
  DataMunger.new(
1318
1276
  {
1319
- :driver => "chefy",
1320
- :platforms => [
1321
- { :name => "plat" }
1277
+ driver: "chefy",
1278
+ platforms: [
1279
+ { name: "plat" },
1280
+ ],
1281
+ suites: [
1282
+ { name: "sweet" },
1322
1283
  ],
1323
- :suites => [
1324
- { :name => "sweet" }
1325
- ]
1326
1284
  },
1327
- {
1328
- key => "datvalue"
1329
- }
1285
+ key => "datvalue"
1330
1286
  ).driver_data_for("sweet", "plat").must_equal(
1331
1287
  :name => "chefy",
1332
1288
  key => "datvalue"
@@ -1336,16 +1292,16 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1336
1292
  it "is returned when provided in user data" do
1337
1293
  DataMunger.new(
1338
1294
  {
1339
- :kitchen => {
1340
- key => "datvalue"
1295
+ kitchen: {
1296
+ key => "datvalue",
1341
1297
  },
1342
- :driver => "chefy",
1343
- :platforms => [
1344
- { :name => "plat" }
1298
+ driver: "chefy",
1299
+ platforms: [
1300
+ { name: "plat" },
1301
+ ],
1302
+ suites: [
1303
+ { name: "sweet" },
1345
1304
  ],
1346
- :suites => [
1347
- { :name => "sweet" }
1348
- ]
1349
1305
  },
1350
1306
  {}
1351
1307
  ).driver_data_for("sweet", "plat").must_equal(
@@ -1357,20 +1313,18 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1357
1313
  it "user data value beats provided value" do
1358
1314
  DataMunger.new(
1359
1315
  {
1360
- :kitchen => {
1361
- key => "datvalue"
1316
+ kitchen: {
1317
+ key => "datvalue",
1362
1318
  },
1363
- :driver => "chefy",
1364
- :platforms => [
1365
- { :name => "plat" }
1319
+ driver: "chefy",
1320
+ platforms: [
1321
+ { name: "plat" },
1322
+ ],
1323
+ suites: [
1324
+ { name: "sweet" },
1366
1325
  ],
1367
- :suites => [
1368
- { :name => "sweet" }
1369
- ]
1370
1326
  },
1371
- {
1372
- key => "ilose"
1373
- }
1327
+ key => "ilose"
1374
1328
  ).driver_data_for("sweet", "plat").must_equal(
1375
1329
  :name => "chefy",
1376
1330
  key => "datvalue"
@@ -1380,39 +1334,38 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1380
1334
  it "rejects any value in driver data" do
1381
1335
  DataMunger.new(
1382
1336
  {
1383
- :driver => {
1337
+ driver: {
1384
1338
  :name => "chefy",
1385
- key => "imevil"
1339
+ key => "imevil",
1386
1340
  },
1387
- :platforms => [
1388
- { :name => "plat" }
1341
+ platforms: [
1342
+ { name: "plat" },
1343
+ ],
1344
+ suites: [
1345
+ { name: "sweet" },
1389
1346
  ],
1390
- :suites => [
1391
- { :name => "sweet" }
1392
- ]
1393
1347
  },
1394
1348
  {}
1395
1349
  ).driver_data_for("sweet", "plat").must_equal(
1396
- :name => "chefy"
1350
+ name: "chefy"
1397
1351
  )
1398
1352
  end
1399
1353
  end
1400
1354
 
1401
1355
  describe "for #provisioner_data_for" do
1402
-
1403
1356
  it "uses value in provisioner data" do
1404
1357
  DataMunger.new(
1405
1358
  {
1406
- :provisioner => {
1359
+ provisioner: {
1407
1360
  :name => "chefy",
1408
- key => "datvalue"
1361
+ key => "datvalue",
1409
1362
  },
1410
- :platforms => [
1411
- { :name => "plat" }
1363
+ platforms: [
1364
+ { name: "plat" },
1365
+ ],
1366
+ suites: [
1367
+ { name: "sweet" },
1412
1368
  ],
1413
- :suites => [
1414
- { :name => "sweet" }
1415
- ]
1416
1369
  },
1417
1370
  {}
1418
1371
  ).provisioner_data_for("sweet", "plat").must_equal(
@@ -1424,40 +1377,37 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1424
1377
  it "rejects any value in user data" do
1425
1378
  DataMunger.new(
1426
1379
  {
1427
- :kitchen => {
1428
- key => "imevil"
1380
+ kitchen: {
1381
+ key => "imevil",
1429
1382
  },
1430
- :provisioner => "chefy",
1431
- :platforms => [
1432
- { :name => "plat" }
1383
+ provisioner: "chefy",
1384
+ platforms: [
1385
+ { name: "plat" },
1386
+ ],
1387
+ suites: [
1388
+ { name: "sweet" },
1433
1389
  ],
1434
- :suites => [
1435
- { :name => "sweet" }
1436
- ]
1437
1390
  },
1438
1391
  {}
1439
1392
  ).provisioner_data_for("sweet", "plat").must_equal(
1440
- :name => "chefy"
1393
+ name: "chefy"
1441
1394
  )
1442
1395
  end
1443
1396
  end
1444
1397
 
1445
1398
  describe "for #verifier_data_for" do
1446
-
1447
1399
  it "is returned when provided" do
1448
1400
  DataMunger.new(
1449
1401
  {
1450
- :verifier => "chefy",
1451
- :platforms => [
1452
- { :name => "plat" }
1402
+ verifier: "chefy",
1403
+ platforms: [
1404
+ { name: "plat" },
1405
+ ],
1406
+ suites: [
1407
+ { name: "sweet" },
1453
1408
  ],
1454
- :suites => [
1455
- { :name => "sweet" }
1456
- ]
1457
1409
  },
1458
- {
1459
- key => "datvalue"
1460
- }
1410
+ key => "datvalue"
1461
1411
  ).verifier_data_for("sweet", "plat").must_equal(
1462
1412
  :name => "chefy",
1463
1413
  key => "datvalue"
@@ -1467,16 +1417,16 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1467
1417
  it "is returned when provided in user data" do
1468
1418
  DataMunger.new(
1469
1419
  {
1470
- :kitchen => {
1471
- key => "datvalue"
1420
+ kitchen: {
1421
+ key => "datvalue",
1472
1422
  },
1473
- :verifier => "chefy",
1474
- :platforms => [
1475
- { :name => "plat" }
1423
+ verifier: "chefy",
1424
+ platforms: [
1425
+ { name: "plat" },
1426
+ ],
1427
+ suites: [
1428
+ { name: "sweet" },
1476
1429
  ],
1477
- :suites => [
1478
- { :name => "sweet" }
1479
- ]
1480
1430
  },
1481
1431
  {}
1482
1432
  ).verifier_data_for("sweet", "plat").must_equal(
@@ -1488,20 +1438,18 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1488
1438
  it "user data value beats provided value" do
1489
1439
  DataMunger.new(
1490
1440
  {
1491
- :kitchen => {
1492
- key => "datvalue"
1441
+ kitchen: {
1442
+ key => "datvalue",
1493
1443
  },
1494
- :verifier => "chefy",
1495
- :platforms => [
1496
- { :name => "plat" }
1444
+ verifier: "chefy",
1445
+ platforms: [
1446
+ { name: "plat" },
1447
+ ],
1448
+ suites: [
1449
+ { name: "sweet" },
1497
1450
  ],
1498
- :suites => [
1499
- { :name => "sweet" }
1500
- ]
1501
1451
  },
1502
- {
1503
- key => "ilose"
1504
- }
1452
+ key => "ilose"
1505
1453
  ).verifier_data_for("sweet", "plat").must_equal(
1506
1454
  :name => "chefy",
1507
1455
  key => "datvalue"
@@ -1511,40 +1459,37 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1511
1459
  it "rejects any value in verifier data" do
1512
1460
  DataMunger.new(
1513
1461
  {
1514
- :verifier => {
1462
+ verifier: {
1515
1463
  :version => "chefy",
1516
- key => "imevil"
1464
+ key => "imevil",
1517
1465
  },
1518
- :platforms => [
1519
- { :name => "plat" }
1466
+ platforms: [
1467
+ { name: "plat" },
1468
+ ],
1469
+ suites: [
1470
+ { name: "sweet" },
1520
1471
  ],
1521
- :suites => [
1522
- { :name => "sweet" }
1523
- ]
1524
1472
  },
1525
1473
  {}
1526
1474
  ).verifier_data_for("sweet", "plat").must_equal(
1527
- :version => "chefy"
1475
+ version: "chefy"
1528
1476
  )
1529
1477
  end
1530
1478
  end
1531
1479
 
1532
1480
  describe "for #transport_data_for" do
1533
-
1534
1481
  it "is returned when provided" do
1535
1482
  DataMunger.new(
1536
1483
  {
1537
- :transport => "pipes",
1538
- :platforms => [
1539
- { :name => "plat" }
1484
+ transport: "pipes",
1485
+ platforms: [
1486
+ { name: "plat" },
1487
+ ],
1488
+ suites: [
1489
+ { name: "sweet" },
1540
1490
  ],
1541
- :suites => [
1542
- { :name => "sweet" }
1543
- ]
1544
1491
  },
1545
- {
1546
- key => "datvalue"
1547
- }
1492
+ key => "datvalue"
1548
1493
  ).transport_data_for("sweet", "plat").must_equal(
1549
1494
  :name => "pipes",
1550
1495
  key => "datvalue"
@@ -1554,16 +1499,16 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1554
1499
  it "is returned when provided in user data" do
1555
1500
  DataMunger.new(
1556
1501
  {
1557
- :kitchen => {
1558
- key => "datvalue"
1502
+ kitchen: {
1503
+ key => "datvalue",
1559
1504
  },
1560
- :transport => "pipes",
1561
- :platforms => [
1562
- { :name => "plat" }
1505
+ transport: "pipes",
1506
+ platforms: [
1507
+ { name: "plat" },
1508
+ ],
1509
+ suites: [
1510
+ { name: "sweet" },
1563
1511
  ],
1564
- :suites => [
1565
- { :name => "sweet" }
1566
- ]
1567
1512
  },
1568
1513
  {}
1569
1514
  ).transport_data_for("sweet", "plat").must_equal(
@@ -1575,20 +1520,18 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1575
1520
  it "user data value beats provided value" do
1576
1521
  DataMunger.new(
1577
1522
  {
1578
- :kitchen => {
1579
- key => "datvalue"
1523
+ kitchen: {
1524
+ key => "datvalue",
1580
1525
  },
1581
- :transport => "pipes",
1582
- :platforms => [
1583
- { :name => "plat" }
1526
+ transport: "pipes",
1527
+ platforms: [
1528
+ { name: "plat" },
1529
+ ],
1530
+ suites: [
1531
+ { name: "sweet" },
1584
1532
  ],
1585
- :suites => [
1586
- { :name => "sweet" }
1587
- ]
1588
1533
  },
1589
- {
1590
- key => "ilose"
1591
- }
1534
+ key => "ilose"
1592
1535
  ).transport_data_for("sweet", "plat").must_equal(
1593
1536
  :name => "pipes",
1594
1537
  key => "datvalue"
@@ -1598,20 +1541,20 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1598
1541
  it "rejects any value in transport data" do
1599
1542
  DataMunger.new(
1600
1543
  {
1601
- :transport => {
1544
+ transport: {
1602
1545
  :name => "pipes",
1603
- key => "imevil"
1546
+ key => "imevil",
1604
1547
  },
1605
- :platforms => [
1606
- { :name => "plat" }
1548
+ platforms: [
1549
+ { name: "plat" },
1550
+ ],
1551
+ suites: [
1552
+ { name: "sweet" },
1607
1553
  ],
1608
- :suites => [
1609
- { :name => "sweet" }
1610
- ]
1611
1554
  },
1612
1555
  {}
1613
1556
  ).transport_data_for("sweet", "plat").must_equal(
1614
- :name => "pipes"
1557
+ name: "pipes"
1615
1558
  )
1616
1559
  end
1617
1560
  end
@@ -1620,198 +1563,195 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1620
1563
  end
1621
1564
 
1622
1565
  describe "legacy driver_config and driver_plugin" do
1623
-
1624
1566
  describe "from a single source" do
1625
-
1626
1567
  it "returns common driver name" do
1627
1568
  DataMunger.new(
1628
1569
  {
1629
- :driver_plugin => "starship"
1570
+ driver_plugin: "starship",
1630
1571
  },
1631
1572
  {}
1632
1573
  ).driver_data_for("suite", "platform").must_equal(
1633
- :name => "starship"
1574
+ name: "starship"
1634
1575
  )
1635
1576
  end
1636
1577
 
1637
1578
  it "merges driver into driver_plugin if driver exists" do
1638
1579
  DataMunger.new(
1639
1580
  {
1640
- :driver_plugin => "starship",
1641
- :driver => "zappa"
1581
+ driver_plugin: "starship",
1582
+ driver: "zappa",
1642
1583
  },
1643
1584
  {}
1644
1585
  ).driver_data_for("suite", "platform").must_equal(
1645
- :name => "zappa"
1586
+ name: "zappa"
1646
1587
  )
1647
1588
  end
1648
1589
 
1649
1590
  it "returns common driver config" do
1650
1591
  DataMunger.new(
1651
1592
  {
1652
- :driver_plugin => "starship",
1653
- :driver_config => {
1654
- :speed => 42
1655
- }
1593
+ driver_plugin: "starship",
1594
+ driver_config: {
1595
+ speed: 42,
1596
+ },
1656
1597
  },
1657
1598
  {}
1658
1599
  ).driver_data_for("suite", "platform").must_equal(
1659
- :name => "starship",
1660
- :speed => 42
1600
+ name: "starship",
1601
+ speed: 42
1661
1602
  )
1662
1603
  end
1663
1604
 
1664
1605
  it "merges driver into driver_config if driver with name exists" do
1665
1606
  DataMunger.new(
1666
1607
  {
1667
- :driver_config => {
1668
- :eh => "yep"
1608
+ driver_config: {
1609
+ eh: "yep",
1669
1610
  },
1670
- :driver => "zappa"
1611
+ driver: "zappa",
1671
1612
  },
1672
1613
  {}
1673
1614
  ).driver_data_for("suite", "platform").must_equal(
1674
- :name => "zappa",
1675
- :eh => "yep"
1615
+ name: "zappa",
1616
+ eh: "yep"
1676
1617
  )
1677
1618
  end
1678
1619
 
1679
1620
  it "merges driver into driver_config if driver exists" do
1680
1621
  DataMunger.new(
1681
1622
  {
1682
- :driver_plugin => "imold",
1683
- :driver_config => {
1684
- :eh => "yep",
1685
- :color => "pink"
1623
+ driver_plugin: "imold",
1624
+ driver_config: {
1625
+ eh: "yep",
1626
+ color: "pink",
1627
+ },
1628
+ driver: {
1629
+ name: "zappa",
1630
+ color: "black",
1686
1631
  },
1687
- :driver => {
1688
- :name => "zappa",
1689
- :color => "black"
1690
- }
1691
1632
  },
1692
1633
  {}
1693
1634
  ).driver_data_for("suite", "platform").must_equal(
1694
- :name => "zappa",
1695
- :eh => "yep",
1696
- :color => "black"
1635
+ name: "zappa",
1636
+ eh: "yep",
1637
+ color: "black"
1697
1638
  )
1698
1639
  end
1699
1640
 
1700
1641
  it "returns platform driver name" do
1701
1642
  DataMunger.new(
1702
1643
  {
1703
- :platforms => [
1644
+ platforms: [
1704
1645
  {
1705
- :name => "plat",
1706
- :driver_plugin => "flip"
1707
- }
1708
- ]
1646
+ name: "plat",
1647
+ driver_plugin: "flip",
1648
+ },
1649
+ ],
1709
1650
  },
1710
1651
  {}
1711
1652
  ).driver_data_for("suite", "plat").must_equal(
1712
- :name => "flip"
1653
+ name: "flip"
1713
1654
  )
1714
1655
  end
1715
1656
 
1716
1657
  it "returns platform config containing driver hash" do
1717
1658
  DataMunger.new(
1718
1659
  {
1719
- :platforms => [
1660
+ platforms: [
1720
1661
  {
1721
- :name => "plat",
1722
- :driver_plugin => "flip",
1723
- :driver_config => {
1724
- :flop => "yep"
1725
- }
1726
- }
1727
- ]
1662
+ name: "plat",
1663
+ driver_plugin: "flip",
1664
+ driver_config: {
1665
+ flop: "yep",
1666
+ },
1667
+ },
1668
+ ],
1728
1669
  },
1729
1670
  {}
1730
1671
  ).driver_data_for("suite", "plat").must_equal(
1731
- :name => "flip",
1732
- :flop => "yep"
1672
+ name: "flip",
1673
+ flop: "yep"
1733
1674
  )
1734
1675
  end
1735
1676
 
1736
1677
  it "returns suite driver name" do
1737
1678
  DataMunger.new(
1738
1679
  {
1739
- :suites => [
1680
+ suites: [
1740
1681
  {
1741
- :name => "sweet",
1742
- :driver_plugin => "waz"
1743
- }
1744
- ]
1682
+ name: "sweet",
1683
+ driver_plugin: "waz",
1684
+ },
1685
+ ],
1745
1686
  },
1746
1687
  {}
1747
1688
  ).driver_data_for("sweet", "platform").must_equal(
1748
- :name => "waz"
1689
+ name: "waz"
1749
1690
  )
1750
1691
  end
1751
1692
 
1752
1693
  it "returns suite config containing driver hash" do
1753
1694
  DataMunger.new(
1754
1695
  {
1755
- :suites => [
1696
+ suites: [
1756
1697
  {
1757
- :name => "sweet",
1758
- :driver_plugin => "waz",
1759
- :driver_config => {
1760
- :up => "nope"
1761
- }
1762
- }
1763
- ]
1698
+ name: "sweet",
1699
+ driver_plugin: "waz",
1700
+ driver_config: {
1701
+ up: "nope",
1702
+ },
1703
+ },
1704
+ ],
1764
1705
  },
1765
1706
  {}
1766
1707
  ).driver_data_for("sweet", "platform").must_equal(
1767
- :name => "waz",
1768
- :up => "nope"
1708
+ name: "waz",
1709
+ up: "nope"
1769
1710
  )
1770
1711
  end
1771
1712
  end
1772
1713
 
1773
1714
  describe "from multiple sources" do
1774
-
1775
1715
  it "suite into platform into common" do
1776
1716
  DataMunger.new(
1777
1717
  {
1778
- :driver_plugin => "commony",
1779
- :driver_config => {
1780
- :color => "purple",
1781
- :fruit => %w[apple pear],
1782
- :deep => { :common => "junk" }
1718
+ driver_plugin: "commony",
1719
+ driver_config: {
1720
+ color: "purple",
1721
+ fruit: %w{apple pear},
1722
+ deep: { common: "junk" },
1783
1723
  },
1784
- :platforms => [
1724
+ platforms: [
1785
1725
  {
1786
- :name => "plat",
1787
- :driver_plugin => "platformy",
1788
- :driver_config => {
1789
- :fruit => ["banana"],
1790
- :deep => { :platform => "stuff" }
1791
- }
1792
- }
1726
+ name: "plat",
1727
+ driver_plugin: "platformy",
1728
+ driver_config: {
1729
+ fruit: ["banana"],
1730
+ deep: { platform: "stuff" },
1731
+ },
1732
+ },
1793
1733
  ],
1794
- :suites => [
1734
+ suites: [
1795
1735
  {
1796
- :name => "sweet",
1797
- :driver_plugin => "suitey",
1798
- :driver_config => {
1799
- :vehicle => "car",
1800
- :deep => { :suite => "things" }
1801
- }
1802
- }
1803
- ]
1736
+ name: "sweet",
1737
+ driver_plugin: "suitey",
1738
+ driver_config: {
1739
+ vehicle: "car",
1740
+ deep: { suite: "things" },
1741
+ },
1742
+ },
1743
+ ],
1804
1744
  },
1805
1745
  {}
1806
1746
  ).driver_data_for("sweet", "plat").must_equal(
1807
- :name => "suitey",
1808
- :color => "purple",
1809
- :fruit => ["banana"],
1810
- :vehicle => "car",
1811
- :deep => {
1812
- :common => "junk",
1813
- :platform => "stuff",
1814
- :suite => "things"
1747
+ name: "suitey",
1748
+ color: "purple",
1749
+ fruit: ["banana"],
1750
+ vehicle: "car",
1751
+ deep: {
1752
+ common: "junk",
1753
+ platform: "stuff",
1754
+ suite: "things",
1815
1755
  }
1816
1756
  )
1817
1757
  end
@@ -1819,31 +1759,31 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1819
1759
  it "platform into common" do
1820
1760
  DataMunger.new(
1821
1761
  {
1822
- :driver_plugin => "commony",
1823
- :driver_config => {
1824
- :color => "purple",
1825
- :fruit => %w[apple pear],
1826
- :deep => { :common => "junk" }
1762
+ driver_plugin: "commony",
1763
+ driver_config: {
1764
+ color: "purple",
1765
+ fruit: %w{apple pear},
1766
+ deep: { common: "junk" },
1827
1767
  },
1828
- :platforms => [
1768
+ platforms: [
1829
1769
  {
1830
- :name => "plat",
1831
- :driver_plugin => "platformy",
1832
- :driver_config => {
1833
- :fruit => ["banana"],
1834
- :deep => { :platform => "stuff" }
1835
- }
1836
- }
1837
- ]
1770
+ name: "plat",
1771
+ driver_plugin: "platformy",
1772
+ driver_config: {
1773
+ fruit: ["banana"],
1774
+ deep: { platform: "stuff" },
1775
+ },
1776
+ },
1777
+ ],
1838
1778
  },
1839
1779
  {}
1840
1780
  ).driver_data_for("sweet", "plat").must_equal(
1841
- :name => "platformy",
1842
- :color => "purple",
1843
- :fruit => ["banana"],
1844
- :deep => {
1845
- :common => "junk",
1846
- :platform => "stuff"
1781
+ name: "platformy",
1782
+ color: "purple",
1783
+ fruit: ["banana"],
1784
+ deep: {
1785
+ common: "junk",
1786
+ platform: "stuff",
1847
1787
  }
1848
1788
  )
1849
1789
  end
@@ -1851,32 +1791,32 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1851
1791
  it "suite into common" do
1852
1792
  DataMunger.new(
1853
1793
  {
1854
- :driver_plugin => "commony",
1855
- :driver_config => {
1856
- :color => "purple",
1857
- :fruit => %w[apple pear],
1858
- :deep => { :common => "junk" }
1794
+ driver_plugin: "commony",
1795
+ driver_config: {
1796
+ color: "purple",
1797
+ fruit: %w{apple pear},
1798
+ deep: { common: "junk" },
1859
1799
  },
1860
- :suites => [
1800
+ suites: [
1861
1801
  {
1862
- :name => "sweet",
1863
- :driver_plugin => "suitey",
1864
- :driver_config => {
1865
- :vehicle => "car",
1866
- :deep => { :suite => "things" }
1867
- }
1868
- }
1869
- ]
1802
+ name: "sweet",
1803
+ driver_plugin: "suitey",
1804
+ driver_config: {
1805
+ vehicle: "car",
1806
+ deep: { suite: "things" },
1807
+ },
1808
+ },
1809
+ ],
1870
1810
  },
1871
1811
  {}
1872
1812
  ).driver_data_for("sweet", "plat").must_equal(
1873
- :name => "suitey",
1874
- :color => "purple",
1875
- :fruit => %w[apple pear],
1876
- :vehicle => "car",
1877
- :deep => {
1878
- :common => "junk",
1879
- :suite => "things"
1813
+ name: "suitey",
1814
+ color: "purple",
1815
+ fruit: %w{apple pear},
1816
+ vehicle: "car",
1817
+ deep: {
1818
+ common: "junk",
1819
+ suite: "things",
1880
1820
  }
1881
1821
  )
1882
1822
  end
@@ -1884,35 +1824,35 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1884
1824
  it "suite into platform" do
1885
1825
  DataMunger.new(
1886
1826
  {
1887
- :platforms => [
1827
+ platforms: [
1888
1828
  {
1889
- :name => "plat",
1890
- :driver_plugin => "platformy",
1891
- :driver_config => {
1892
- :fruit => ["banana"],
1893
- :deep => { :platform => "stuff" }
1894
- }
1895
- }
1829
+ name: "plat",
1830
+ driver_plugin: "platformy",
1831
+ driver_config: {
1832
+ fruit: ["banana"],
1833
+ deep: { platform: "stuff" },
1834
+ },
1835
+ },
1896
1836
  ],
1897
- :suites => [
1837
+ suites: [
1898
1838
  {
1899
- :name => "sweet",
1900
- :driver_plugin => "suitey",
1901
- :driver_config => {
1902
- :vehicle => "car",
1903
- :deep => { :suite => "things" }
1904
- }
1905
- }
1906
- ]
1839
+ name: "sweet",
1840
+ driver_plugin: "suitey",
1841
+ driver_config: {
1842
+ vehicle: "car",
1843
+ deep: { suite: "things" },
1844
+ },
1845
+ },
1846
+ ],
1907
1847
  },
1908
1848
  {}
1909
1849
  ).driver_data_for("sweet", "plat").must_equal(
1910
- :name => "suitey",
1911
- :fruit => ["banana"],
1912
- :vehicle => "car",
1913
- :deep => {
1914
- :platform => "stuff",
1915
- :suite => "things"
1850
+ name: "suitey",
1851
+ fruit: ["banana"],
1852
+ vehicle: "car",
1853
+ deep: {
1854
+ platform: "stuff",
1855
+ suite: "things",
1916
1856
  }
1917
1857
  )
1918
1858
  end
@@ -1920,24 +1860,22 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1920
1860
  end
1921
1861
 
1922
1862
  describe "legacy chef paths from suite" do
1923
-
1924
1863
  LEGACY_CHEF_PATHS = [
1925
1864
  :data_path, :data_bags_path, :environments_path,
1926
1865
  :nodes_path, :roles_path, :encrypted_data_bag_secret_key_path
1927
- ]
1866
+ ].freeze
1928
1867
 
1929
1868
  LEGACY_CHEF_PATHS.each do |key|
1930
-
1931
1869
  it "moves #{key} into provisioner" do
1932
1870
  DataMunger.new(
1933
1871
  {
1934
- :provisioner => "chefy",
1935
- :suites => [
1872
+ provisioner: "chefy",
1873
+ suites: [
1936
1874
  {
1937
1875
  :name => "sweet",
1938
- key => "mypath"
1939
- }
1940
- ]
1876
+ key => "mypath",
1877
+ },
1878
+ ],
1941
1879
  },
1942
1880
  {}
1943
1881
  ).provisioner_data_for("sweet", "plat").must_equal(
@@ -1949,13 +1887,13 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1949
1887
  it "merges provisioner into data_path if provisioner exists" do
1950
1888
  DataMunger.new(
1951
1889
  {
1952
- :suites => [
1890
+ suites: [
1953
1891
  {
1954
1892
  :name => "sweet",
1955
1893
  key => "mypath",
1956
- :provisioner => "chefy"
1957
- }
1958
- ]
1894
+ :provisioner => "chefy",
1895
+ },
1896
+ ],
1959
1897
  },
1960
1898
  {}
1961
1899
  ).provisioner_data_for("sweet", "plat").must_equal(
@@ -1967,688 +1905,681 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
1967
1905
  end
1968
1906
 
1969
1907
  describe "legacy require_chef_omnibus from driver" do
1970
-
1971
1908
  describe "from a single source" do
1972
-
1973
1909
  it "common driver value moves into provisioner" do
1974
1910
  DataMunger.new(
1975
1911
  {
1976
- :provisioner => "chefy",
1977
- :driver => {
1978
- :name => "starship",
1979
- :require_chef_omnibus => "it's probably fine"
1980
- }
1912
+ provisioner: "chefy",
1913
+ driver: {
1914
+ name: "starship",
1915
+ require_chef_omnibus: "it's probably fine",
1916
+ },
1981
1917
  },
1982
1918
  {}
1983
1919
  ).provisioner_data_for("suite", "platform").must_equal(
1984
- :name => "chefy",
1985
- :require_chef_omnibus => "it's probably fine"
1920
+ name: "chefy",
1921
+ require_chef_omnibus: "it's probably fine"
1986
1922
  )
1987
1923
  end
1988
1924
 
1989
1925
  it "common driver value loses to existing provisioner value" do
1990
1926
  DataMunger.new(
1991
1927
  {
1992
- :provisioner => {
1993
- :name => "chefy",
1994
- :require_chef_omnibus => "it's probably fine"
1928
+ provisioner: {
1929
+ name: "chefy",
1930
+ require_chef_omnibus: "it's probably fine",
1931
+ },
1932
+ driver: {
1933
+ name: "starship",
1934
+ require_chef_omnibus: "dragons",
1995
1935
  },
1996
- :driver => {
1997
- :name => "starship",
1998
- :require_chef_omnibus => "dragons"
1999
- }
2000
1936
  },
2001
1937
  {}
2002
1938
  ).provisioner_data_for("suite", "platform").must_equal(
2003
- :name => "chefy",
2004
- :require_chef_omnibus => "it's probably fine"
1939
+ name: "chefy",
1940
+ require_chef_omnibus: "it's probably fine"
2005
1941
  )
2006
1942
  end
2007
1943
 
2008
1944
  it "suite driver value moves into provisioner" do
2009
1945
  DataMunger.new(
2010
1946
  {
2011
- :suites => [
1947
+ suites: [
2012
1948
  {
2013
- :name => "sweet",
2014
- :provisioner => "chefy",
2015
- :driver => {
2016
- :name => "starship",
2017
- :require_chef_omnibus => "it's probably fine"
2018
- }
2019
- }
2020
- ]
1949
+ name: "sweet",
1950
+ provisioner: "chefy",
1951
+ driver: {
1952
+ name: "starship",
1953
+ require_chef_omnibus: "it's probably fine",
1954
+ },
1955
+ },
1956
+ ],
2021
1957
  },
2022
1958
  {}
2023
1959
  ).provisioner_data_for("sweet", "platform").must_equal(
2024
- :name => "chefy",
2025
- :require_chef_omnibus => "it's probably fine"
1960
+ name: "chefy",
1961
+ require_chef_omnibus: "it's probably fine"
2026
1962
  )
2027
1963
  end
2028
1964
 
2029
1965
  it "suite driver value loses to existing provisioner value" do
2030
1966
  DataMunger.new(
2031
1967
  {
2032
- :suites => [
1968
+ suites: [
2033
1969
  {
2034
- :name => "sweet",
2035
- :provisioner => {
2036
- :name => "chefy",
2037
- :require_chef_omnibus => "it's probably fine"
1970
+ name: "sweet",
1971
+ provisioner: {
1972
+ name: "chefy",
1973
+ require_chef_omnibus: "it's probably fine",
1974
+ },
1975
+ driver: {
1976
+ name: "starship",
1977
+ require_chef_omnibus: "dragons",
2038
1978
  },
2039
- :driver => {
2040
- :name => "starship",
2041
- :require_chef_omnibus => "dragons"
2042
- }
2043
- }
2044
- ]
1979
+ },
1980
+ ],
2045
1981
  },
2046
1982
  {}
2047
1983
  ).provisioner_data_for("sweet", "platform").must_equal(
2048
- :name => "chefy",
2049
- :require_chef_omnibus => "it's probably fine"
1984
+ name: "chefy",
1985
+ require_chef_omnibus: "it's probably fine"
2050
1986
  )
2051
1987
  end
2052
1988
 
2053
1989
  it "platform driver value moves into provisioner" do
2054
1990
  DataMunger.new(
2055
1991
  {
2056
- :platforms => [
1992
+ platforms: [
2057
1993
  {
2058
- :name => "plat",
2059
- :provisioner => "chefy",
2060
- :driver => {
2061
- :name => "starship",
2062
- :require_chef_omnibus => "it's probably fine"
2063
- }
2064
- }
2065
- ]
1994
+ name: "plat",
1995
+ provisioner: "chefy",
1996
+ driver: {
1997
+ name: "starship",
1998
+ require_chef_omnibus: "it's probably fine",
1999
+ },
2000
+ },
2001
+ ],
2066
2002
  },
2067
2003
  {}
2068
2004
  ).provisioner_data_for("suite", "plat").must_equal(
2069
- :name => "chefy",
2070
- :require_chef_omnibus => "it's probably fine"
2005
+ name: "chefy",
2006
+ require_chef_omnibus: "it's probably fine"
2071
2007
  )
2072
2008
  end
2073
2009
 
2074
2010
  it "platform driver value loses to existing provisioner value" do
2075
2011
  DataMunger.new(
2076
2012
  {
2077
- :platforms => [
2013
+ platforms: [
2078
2014
  {
2079
- :name => "plat",
2080
- :provisioner => {
2081
- :name => "chefy",
2082
- :require_chef_omnibus => "it's probably fine"
2015
+ name: "plat",
2016
+ provisioner: {
2017
+ name: "chefy",
2018
+ require_chef_omnibus: "it's probably fine",
2019
+ },
2020
+ driver: {
2021
+ name: "starship",
2022
+ require_chef_omnibus: "dragons",
2083
2023
  },
2084
- :driver => {
2085
- :name => "starship",
2086
- :require_chef_omnibus => "dragons"
2087
- }
2088
- }
2089
- ]
2024
+ },
2025
+ ],
2090
2026
  },
2091
2027
  {}
2092
2028
  ).provisioner_data_for("suite", "plat").must_equal(
2093
- :name => "chefy",
2094
- :require_chef_omnibus => "it's probably fine"
2029
+ name: "chefy",
2030
+ require_chef_omnibus: "it's probably fine"
2095
2031
  )
2096
2032
  end
2097
2033
  end
2098
2034
  end
2099
2035
 
2100
2036
  describe "legacy http_proxy & https_proxy from driver" do
2101
-
2102
2037
  describe "from a single source" do
2103
-
2104
2038
  it "common driver value remains in driver" do
2105
2039
  DataMunger.new(
2106
2040
  {
2107
- :provisioner => "chefy",
2108
- :driver => {
2109
- :name => "starship",
2110
- :http_proxy => "http://proxy",
2111
- :https_proxy => "https://proxy"
2112
- }
2041
+ provisioner: "chefy",
2042
+ driver: {
2043
+ name: "starship",
2044
+ http_proxy: "http://proxy",
2045
+ https_proxy: "https://proxy",
2046
+ },
2113
2047
  },
2114
2048
  {}
2115
2049
  ).driver_data_for("suite", "platform").must_equal(
2116
- :name => "starship",
2117
- :http_proxy => "http://proxy",
2118
- :https_proxy => "https://proxy"
2050
+ name: "starship",
2051
+ http_proxy: "http://proxy",
2052
+ https_proxy: "https://proxy"
2119
2053
  )
2120
2054
  end
2121
2055
 
2122
2056
  it "common driver value copies into provisioner" do
2123
2057
  DataMunger.new(
2124
2058
  {
2125
- :provisioner => "chefy",
2126
- :driver => {
2127
- :name => "starship",
2128
- :http_proxy => "http://proxy",
2129
- :https_proxy => "https://proxy"
2130
- }
2059
+ provisioner: "chefy",
2060
+ driver: {
2061
+ name: "starship",
2062
+ http_proxy: "http://proxy",
2063
+ https_proxy: "https://proxy",
2064
+ },
2131
2065
  },
2132
2066
  {}
2133
2067
  ).provisioner_data_for("suite", "platform").must_equal(
2134
- :name => "chefy",
2135
- :http_proxy => "http://proxy",
2136
- :https_proxy => "https://proxy"
2068
+ name: "chefy",
2069
+ http_proxy: "http://proxy",
2070
+ https_proxy: "https://proxy"
2137
2071
  )
2138
2072
  end
2139
2073
 
2140
2074
  it "common driver value copies into verifier" do
2141
2075
  DataMunger.new(
2142
2076
  {
2143
- :verifier => "bussy",
2144
- :driver => {
2145
- :name => "starship",
2146
- :http_proxy => "http://proxy",
2147
- :https_proxy => "https://proxy"
2148
- }
2077
+ verifier: "bussy",
2078
+ driver: {
2079
+ name: "starship",
2080
+ http_proxy: "http://proxy",
2081
+ https_proxy: "https://proxy",
2082
+ },
2149
2083
  },
2150
2084
  {}
2151
2085
  ).verifier_data_for("suite", "platform").must_equal(
2152
- :name => "bussy",
2153
- :http_proxy => "http://proxy",
2154
- :https_proxy => "https://proxy"
2086
+ name: "bussy",
2087
+ http_proxy: "http://proxy",
2088
+ https_proxy: "https://proxy"
2155
2089
  )
2156
2090
  end
2157
2091
 
2158
2092
  it "common driver value loses to existing provisioner value" do
2159
2093
  DataMunger.new(
2160
2094
  {
2161
- :provisioner => {
2162
- :name => "chefy",
2163
- :http_proxy => "it's probably fine",
2164
- :https_proxy => "la quinta"
2095
+ provisioner: {
2096
+ name: "chefy",
2097
+ http_proxy: "it's probably fine",
2098
+ https_proxy: "la quinta",
2099
+ },
2100
+ driver: {
2101
+ name: "starship",
2102
+ http_proxy: "dragons",
2103
+ https_proxy: "cats",
2165
2104
  },
2166
- :driver => {
2167
- :name => "starship",
2168
- :http_proxy => "dragons",
2169
- :https_proxy => "cats"
2170
- }
2171
2105
  },
2172
2106
  {}
2173
2107
  ).provisioner_data_for("suite", "platform").must_equal(
2174
- :name => "chefy",
2175
- :http_proxy => "it's probably fine",
2176
- :https_proxy => "la quinta"
2108
+ name: "chefy",
2109
+ http_proxy: "it's probably fine",
2110
+ https_proxy: "la quinta"
2177
2111
  )
2178
2112
  end
2179
2113
 
2180
2114
  it "common driver value loses to existing verifier value" do
2181
2115
  DataMunger.new(
2182
2116
  {
2183
- :verifier => {
2184
- :name => "bussy",
2185
- :http_proxy => "it's probably fine",
2186
- :https_proxy => "la quinta"
2117
+ verifier: {
2118
+ name: "bussy",
2119
+ http_proxy: "it's probably fine",
2120
+ https_proxy: "la quinta",
2121
+ },
2122
+ driver: {
2123
+ name: "starship",
2124
+ http_proxy: "dragons",
2125
+ https_proxy: "cats",
2187
2126
  },
2188
- :driver => {
2189
- :name => "starship",
2190
- :http_proxy => "dragons",
2191
- :https_proxy => "cats"
2192
- }
2193
2127
  },
2194
2128
  {}
2195
2129
  ).verifier_data_for("suite", "platform").must_equal(
2196
- :name => "bussy",
2197
- :http_proxy => "it's probably fine",
2198
- :https_proxy => "la quinta"
2130
+ name: "bussy",
2131
+ http_proxy: "it's probably fine",
2132
+ https_proxy: "la quinta"
2199
2133
  )
2200
2134
  end
2201
2135
 
2202
2136
  it "suite driver value remains in driver" do
2203
2137
  DataMunger.new(
2204
2138
  {
2205
- :suites => [
2139
+ suites: [
2206
2140
  {
2207
- :name => "sweet",
2208
- :provisioner => "chefy",
2209
- :driver => {
2210
- :name => "starship",
2211
- :http_proxy => "it's probably fine",
2212
- :https_proxy => "la quinta"
2213
- }
2214
- }
2215
- ]
2141
+ name: "sweet",
2142
+ provisioner: "chefy",
2143
+ driver: {
2144
+ name: "starship",
2145
+ http_proxy: "it's probably fine",
2146
+ https_proxy: "la quinta",
2147
+ },
2148
+ },
2149
+ ],
2216
2150
  },
2217
2151
  {}
2218
2152
  ).driver_data_for("sweet", "platform").must_equal(
2219
- :name => "starship",
2220
- :http_proxy => "it's probably fine",
2221
- :https_proxy => "la quinta"
2153
+ name: "starship",
2154
+ http_proxy: "it's probably fine",
2155
+ https_proxy: "la quinta"
2222
2156
  )
2223
2157
  end
2224
2158
 
2225
2159
  it "suite driver value copies into provisioner" do
2226
2160
  DataMunger.new(
2227
2161
  {
2228
- :suites => [
2162
+ suites: [
2229
2163
  {
2230
- :name => "sweet",
2231
- :provisioner => "chefy",
2232
- :driver => {
2233
- :name => "starship",
2234
- :http_proxy => "it's probably fine",
2235
- :https_proxy => "la quinta"
2236
- }
2237
- }
2238
- ]
2164
+ name: "sweet",
2165
+ provisioner: "chefy",
2166
+ driver: {
2167
+ name: "starship",
2168
+ http_proxy: "it's probably fine",
2169
+ https_proxy: "la quinta",
2170
+ },
2171
+ },
2172
+ ],
2239
2173
  },
2240
2174
  {}
2241
2175
  ).provisioner_data_for("sweet", "platform").must_equal(
2242
- :name => "chefy",
2243
- :http_proxy => "it's probably fine",
2244
- :https_proxy => "la quinta"
2176
+ name: "chefy",
2177
+ http_proxy: "it's probably fine",
2178
+ https_proxy: "la quinta"
2245
2179
  )
2246
2180
  end
2247
2181
 
2248
2182
  it "suite driver value copies into verifier" do
2249
2183
  DataMunger.new(
2250
2184
  {
2251
- :suites => [
2185
+ suites: [
2252
2186
  {
2253
- :name => "sweet",
2254
- :verifier => "bussy",
2255
- :driver => {
2256
- :name => "starship",
2257
- :http_proxy => "it's probably fine",
2258
- :https_proxy => "la quinta"
2259
- }
2260
- }
2261
- ]
2187
+ name: "sweet",
2188
+ verifier: "bussy",
2189
+ driver: {
2190
+ name: "starship",
2191
+ http_proxy: "it's probably fine",
2192
+ https_proxy: "la quinta",
2193
+ },
2194
+ },
2195
+ ],
2262
2196
  },
2263
2197
  {}
2264
2198
  ).verifier_data_for("sweet", "platform").must_equal(
2265
- :name => "bussy",
2266
- :http_proxy => "it's probably fine",
2267
- :https_proxy => "la quinta"
2199
+ name: "bussy",
2200
+ http_proxy: "it's probably fine",
2201
+ https_proxy: "la quinta"
2268
2202
  )
2269
2203
  end
2270
2204
 
2271
2205
  it "suite driver value loses to existing provisioner value" do
2272
2206
  DataMunger.new(
2273
2207
  {
2274
- :suites => [
2208
+ suites: [
2275
2209
  {
2276
- :name => "sweet",
2277
- :provisioner => {
2278
- :name => "chefy",
2279
- :http_proxy => "it's probably fine",
2280
- :https_proxy => "la quinta"
2210
+ name: "sweet",
2211
+ provisioner: {
2212
+ name: "chefy",
2213
+ http_proxy: "it's probably fine",
2214
+ https_proxy: "la quinta",
2215
+ },
2216
+ driver: {
2217
+ name: "starship",
2218
+ http_proxy: "dragons",
2219
+ https_proxy: "cats",
2281
2220
  },
2282
- :driver => {
2283
- :name => "starship",
2284
- :http_proxy => "dragons",
2285
- :https_proxy => "cats"
2286
- }
2287
- }
2288
- ]
2221
+ },
2222
+ ],
2289
2223
  },
2290
2224
  {}
2291
2225
  ).provisioner_data_for("sweet", "platform").must_equal(
2292
- :name => "chefy",
2293
- :http_proxy => "it's probably fine",
2294
- :https_proxy => "la quinta"
2226
+ name: "chefy",
2227
+ http_proxy: "it's probably fine",
2228
+ https_proxy: "la quinta"
2295
2229
  )
2296
2230
  end
2297
2231
 
2298
2232
  it "suite driver value loses to existing verifier value" do
2299
2233
  DataMunger.new(
2300
2234
  {
2301
- :suites => [
2235
+ suites: [
2302
2236
  {
2303
- :name => "sweet",
2304
- :verifier => {
2305
- :name => "bussy",
2306
- :http_proxy => "it's probably fine",
2307
- :https_proxy => "la quinta"
2237
+ name: "sweet",
2238
+ verifier: {
2239
+ name: "bussy",
2240
+ http_proxy: "it's probably fine",
2241
+ https_proxy: "la quinta",
2308
2242
  },
2309
- :driver => {
2310
- :name => "starship",
2311
- :http_proxy => "dragons",
2312
- :https_proxy => "cats"
2313
- }
2314
- }
2315
- ]
2243
+ driver: {
2244
+ name: "starship",
2245
+ http_proxy: "dragons",
2246
+ https_proxy: "cats",
2247
+ },
2248
+ },
2249
+ ],
2316
2250
  },
2317
2251
  {}
2318
2252
  ).verifier_data_for("sweet", "platform").must_equal(
2319
- :name => "bussy",
2320
- :http_proxy => "it's probably fine",
2321
- :https_proxy => "la quinta"
2253
+ name: "bussy",
2254
+ http_proxy: "it's probably fine",
2255
+ https_proxy: "la quinta"
2322
2256
  )
2323
2257
  end
2324
2258
 
2325
2259
  it "platform driver value remains in driver" do
2326
2260
  DataMunger.new(
2327
2261
  {
2328
- :platforms => [
2262
+ platforms: [
2329
2263
  {
2330
- :name => "plat",
2331
- :provisioner => "chefy",
2332
- :driver => {
2333
- :name => "starship",
2334
- :http_proxy => "it's probably fine",
2335
- :https_proxy => "la quinta"
2336
- }
2337
- }
2338
- ]
2264
+ name: "plat",
2265
+ provisioner: "chefy",
2266
+ driver: {
2267
+ name: "starship",
2268
+ http_proxy: "it's probably fine",
2269
+ https_proxy: "la quinta",
2270
+ },
2271
+ },
2272
+ ],
2339
2273
  },
2340
2274
  {}
2341
2275
  ).driver_data_for("suite", "plat").must_equal(
2342
- :name => "starship",
2343
- :http_proxy => "it's probably fine",
2344
- :https_proxy => "la quinta"
2276
+ name: "starship",
2277
+ http_proxy: "it's probably fine",
2278
+ https_proxy: "la quinta"
2345
2279
  )
2346
2280
  end
2347
2281
 
2348
2282
  it "platform driver value copies into provisioner" do
2349
2283
  DataMunger.new(
2350
2284
  {
2351
- :platforms => [
2285
+ platforms: [
2352
2286
  {
2353
- :name => "plat",
2354
- :provisioner => "chefy",
2355
- :driver => {
2356
- :name => "starship",
2357
- :http_proxy => "it's probably fine",
2358
- :https_proxy => "la quinta"
2359
- }
2360
- }
2361
- ]
2287
+ name: "plat",
2288
+ provisioner: "chefy",
2289
+ driver: {
2290
+ name: "starship",
2291
+ http_proxy: "it's probably fine",
2292
+ https_proxy: "la quinta",
2293
+ },
2294
+ },
2295
+ ],
2362
2296
  },
2363
2297
  {}
2364
2298
  ).provisioner_data_for("suite", "plat").must_equal(
2365
- :name => "chefy",
2366
- :http_proxy => "it's probably fine",
2367
- :https_proxy => "la quinta"
2299
+ name: "chefy",
2300
+ http_proxy: "it's probably fine",
2301
+ https_proxy: "la quinta"
2368
2302
  )
2369
2303
  end
2370
2304
 
2371
2305
  it "platform driver value copies into verifier" do
2372
2306
  DataMunger.new(
2373
2307
  {
2374
- :platforms => [
2308
+ platforms: [
2375
2309
  {
2376
- :name => "plat",
2377
- :verifier => "bussy",
2378
- :driver => {
2379
- :name => "starship",
2380
- :http_proxy => "it's probably fine",
2381
- :https_proxy => "la quinta"
2382
- }
2383
- }
2384
- ]
2310
+ name: "plat",
2311
+ verifier: "bussy",
2312
+ driver: {
2313
+ name: "starship",
2314
+ http_proxy: "it's probably fine",
2315
+ https_proxy: "la quinta",
2316
+ },
2317
+ },
2318
+ ],
2385
2319
  },
2386
2320
  {}
2387
2321
  ).verifier_data_for("suite", "plat").must_equal(
2388
- :name => "bussy",
2389
- :http_proxy => "it's probably fine",
2390
- :https_proxy => "la quinta"
2322
+ name: "bussy",
2323
+ http_proxy: "it's probably fine",
2324
+ https_proxy: "la quinta"
2391
2325
  )
2392
2326
  end
2393
2327
 
2394
2328
  it "platform driver value loses to existing provisioner value" do
2395
2329
  DataMunger.new(
2396
2330
  {
2397
- :platforms => [
2331
+ platforms: [
2398
2332
  {
2399
- :name => "plat",
2400
- :provisioner => {
2401
- :name => "chefy",
2402
- :http_proxy => "it's probably fine",
2403
- :https_proxy => "la quinta"
2333
+ name: "plat",
2334
+ provisioner: {
2335
+ name: "chefy",
2336
+ http_proxy: "it's probably fine",
2337
+ https_proxy: "la quinta",
2404
2338
  },
2405
- :driver => {
2406
- :name => "starship",
2407
- :http_proxy => "dragons",
2408
- :https_proxy => "cats"
2409
- }
2410
- }
2411
- ]
2339
+ driver: {
2340
+ name: "starship",
2341
+ http_proxy: "dragons",
2342
+ https_proxy: "cats",
2343
+ },
2344
+ },
2345
+ ],
2412
2346
  },
2413
2347
  {}
2414
2348
  ).provisioner_data_for("suite", "plat").must_equal(
2415
- :name => "chefy",
2416
- :http_proxy => "it's probably fine",
2417
- :https_proxy => "la quinta"
2349
+ name: "chefy",
2350
+ http_proxy: "it's probably fine",
2351
+ https_proxy: "la quinta"
2418
2352
  )
2419
2353
  end
2420
2354
 
2421
2355
  it "platform driver value loses to existing verifier value" do
2422
2356
  DataMunger.new(
2423
2357
  {
2424
- :platforms => [
2358
+ platforms: [
2425
2359
  {
2426
- :name => "plat",
2427
- :verifier => {
2428
- :name => "bussy",
2429
- :http_proxy => "it's probably fine",
2430
- :https_proxy => "la quinta"
2360
+ name: "plat",
2361
+ verifier: {
2362
+ name: "bussy",
2363
+ http_proxy: "it's probably fine",
2364
+ https_proxy: "la quinta",
2365
+ },
2366
+ driver: {
2367
+ name: "starship",
2368
+ http_proxy: "dragons",
2369
+ https_proxy: "cats",
2431
2370
  },
2432
- :driver => {
2433
- :name => "starship",
2434
- :http_proxy => "dragons",
2435
- :https_proxy => "cats"
2436
- }
2437
- }
2438
- ]
2371
+ },
2372
+ ],
2439
2373
  },
2440
2374
  {}
2441
2375
  ).verifier_data_for("suite", "plat").must_equal(
2442
- :name => "bussy",
2443
- :http_proxy => "it's probably fine",
2444
- :https_proxy => "la quinta"
2376
+ name: "bussy",
2377
+ http_proxy: "it's probably fine",
2378
+ https_proxy: "la quinta"
2445
2379
  )
2446
2380
  end
2447
2381
  end
2448
2382
  end
2449
2383
 
2450
2384
  describe "legacy busser blocks to verifier" do
2451
-
2452
2385
  describe "from a single source" do
2453
-
2454
2386
  it "merges old common busser name to version into verifier" do
2455
2387
  DataMunger.new(
2456
2388
  {
2457
- :busser => "starship"
2389
+ busser: "starship",
2458
2390
  },
2459
2391
  {}
2460
2392
  ).verifier_data_for("suite", "platform").must_equal(
2461
- :name => "busser",
2462
- :version => "starship"
2393
+ name: "busser",
2394
+ version: "starship"
2463
2395
  )
2464
2396
  end
2465
2397
 
2466
2398
  it "merges old common busser name to version with exising verifier" do
2467
2399
  DataMunger.new(
2468
2400
  {
2469
- :busser => "starship",
2470
- :verifier => {
2471
- :a => "b"
2472
- }
2401
+ busser: "starship",
2402
+ verifier: {
2403
+ a: "b",
2404
+ },
2473
2405
  },
2474
2406
  {}
2475
2407
  ).verifier_data_for("suite", "platform").must_equal(
2476
- :name => "busser",
2477
- :version => "starship",
2478
- :a => "b"
2408
+ name: "busser",
2409
+ version: "starship",
2410
+ a: "b"
2479
2411
  )
2480
2412
  end
2481
2413
 
2482
2414
  it "merges old common busser name to version into verifier with name" do
2483
2415
  DataMunger.new(
2484
2416
  {
2485
- :busser => "starship",
2486
- :verifier => "stellar"
2417
+ busser: "starship",
2418
+ verifier: "stellar",
2487
2419
  },
2488
2420
  {}
2489
2421
  ).verifier_data_for("suite", "platform").must_equal(
2490
- :name => "stellar",
2491
- :version => "starship"
2422
+ name: "stellar",
2423
+ version: "starship"
2492
2424
  )
2493
2425
  end
2494
2426
 
2495
2427
  it "merges old busser data into verifier with name" do
2496
2428
  DataMunger.new(
2497
2429
  {
2498
- :busser => {
2499
- :a => "b"
2430
+ busser: {
2431
+ a: "b",
2500
2432
  },
2501
- :verifier => "stellar"
2433
+ verifier: "stellar",
2502
2434
  },
2503
2435
  {}
2504
2436
  ).verifier_data_for("suite", "platform").must_equal(
2505
- :name => "stellar",
2506
- :a => "b"
2437
+ name: "stellar",
2438
+ a: "b"
2507
2439
  )
2508
2440
  end
2509
2441
 
2510
2442
  it "merges old busser data into verifier data" do
2511
2443
  DataMunger.new(
2512
2444
  {
2513
- :busser => {
2514
- :a => "b",
2515
- :both => "legacy"
2445
+ busser: {
2446
+ a: "b",
2447
+ both: "legacy",
2448
+ },
2449
+ verifier: {
2450
+ name: "stellar",
2451
+ c: "d",
2452
+ both: "modern",
2516
2453
  },
2517
- :verifier => {
2518
- :name => "stellar",
2519
- :c => "d",
2520
- :both => "modern"
2521
- }
2522
2454
  },
2523
2455
  {}
2524
2456
  ).verifier_data_for("suite", "platform").must_equal(
2525
- :name => "stellar",
2526
- :a => "b",
2527
- :c => "d",
2528
- :both => "modern"
2457
+ name: "stellar",
2458
+ a: "b",
2459
+ c: "d",
2460
+ both: "modern"
2529
2461
  )
2530
2462
  end
2531
2463
 
2532
2464
  it "returns platform verifier name" do
2533
2465
  DataMunger.new(
2534
2466
  {
2535
- :platforms => [
2467
+ platforms: [
2536
2468
  {
2537
- :name => "plat",
2538
- :busser => "flip"
2539
- }
2540
- ]
2469
+ name: "plat",
2470
+ busser: "flip",
2471
+ },
2472
+ ],
2541
2473
  },
2542
2474
  {}
2543
2475
  ).verifier_data_for("suite", "plat").must_equal(
2544
- :name => "busser",
2545
- :version => "flip"
2476
+ name: "busser",
2477
+ version: "flip"
2546
2478
  )
2547
2479
  end
2548
2480
 
2549
2481
  it "return platform config containing verifier hash" do
2550
2482
  DataMunger.new(
2551
2483
  {
2552
- :platforms => [
2484
+ platforms: [
2553
2485
  {
2554
- :name => "plat",
2555
- :busser => "flip",
2556
- :verifier => {
2557
- :flop => "yep"
2558
- }
2559
- }
2560
- ]
2486
+ name: "plat",
2487
+ busser: "flip",
2488
+ verifier: {
2489
+ flop: "yep",
2490
+ },
2491
+ },
2492
+ ],
2561
2493
  },
2562
2494
  {}
2563
2495
  ).verifier_data_for("suite", "plat").must_equal(
2564
- :name => "busser",
2565
- :version => "flip",
2566
- :flop => "yep"
2496
+ name: "busser",
2497
+ version: "flip",
2498
+ flop: "yep"
2567
2499
  )
2568
2500
  end
2569
2501
 
2570
2502
  it "returns suite driver name" do
2571
2503
  DataMunger.new(
2572
2504
  {
2573
- :suites => [
2505
+ suites: [
2574
2506
  {
2575
- :name => "sweet",
2576
- :busser => "waz"
2577
- }
2578
- ]
2507
+ name: "sweet",
2508
+ busser: "waz",
2509
+ },
2510
+ ],
2579
2511
  },
2580
2512
  {}
2581
2513
  ).verifier_data_for("sweet", "platform").must_equal(
2582
- :name => "busser",
2583
- :version => "waz"
2514
+ name: "busser",
2515
+ version: "waz"
2584
2516
  )
2585
2517
  end
2586
2518
 
2587
2519
  it "returns suite config containing verifier hash" do
2588
2520
  DataMunger.new(
2589
2521
  {
2590
- :suites => [
2522
+ suites: [
2591
2523
  {
2592
- :name => "sweet",
2593
- :busser => "waz",
2594
- :verifier => {
2595
- :up => "nope"
2596
- }
2597
- }
2598
- ]
2524
+ name: "sweet",
2525
+ busser: "waz",
2526
+ verifier: {
2527
+ up: "nope",
2528
+ },
2529
+ },
2530
+ ],
2599
2531
  },
2600
2532
  {}
2601
2533
  ).verifier_data_for("sweet", "platform").must_equal(
2602
- :name => "busser",
2603
- :version => "waz",
2604
- :up => "nope"
2534
+ name: "busser",
2535
+ version: "waz",
2536
+ up: "nope"
2605
2537
  )
2606
2538
  end
2607
2539
  end
2608
2540
 
2609
2541
  describe "from multiple sources" do
2610
-
2611
2542
  it "suite into platform into common" do
2612
2543
  DataMunger.new(
2613
2544
  {
2614
- :busser => {
2615
- :version => "commony",
2616
- :color => "purple",
2617
- :fruit => %w[apple pear],
2618
- :deep => { :common => "junk" }
2545
+ busser: {
2546
+ version: "commony",
2547
+ color: "purple",
2548
+ fruit: %w{apple pear},
2549
+ deep: { common: "junk" },
2619
2550
  },
2620
- :platforms => [
2551
+ platforms: [
2621
2552
  {
2622
- :name => "plat",
2623
- :busser => {
2624
- :version => "platformy",
2625
- :fruit => ["banana"],
2626
- :deep => { :platform => "stuff" }
2627
- }
2628
- }
2553
+ name: "plat",
2554
+ busser: {
2555
+ version: "platformy",
2556
+ fruit: ["banana"],
2557
+ deep: { platform: "stuff" },
2558
+ },
2559
+ },
2629
2560
  ],
2630
- :suites => [
2561
+ suites: [
2631
2562
  {
2632
- :name => "sweet",
2633
- :busser => {
2634
- :version => "suitey",
2635
- :vehicle => "car",
2636
- :deep => { :suite => "things" }
2637
- }
2638
- }
2639
- ]
2563
+ name: "sweet",
2564
+ busser: {
2565
+ version: "suitey",
2566
+ vehicle: "car",
2567
+ deep: { suite: "things" },
2568
+ },
2569
+ },
2570
+ ],
2640
2571
  },
2641
2572
  {}
2642
2573
  ).verifier_data_for("sweet", "plat").must_equal(
2643
- :name => "busser",
2644
- :version => "suitey",
2645
- :color => "purple",
2646
- :fruit => ["banana"],
2647
- :vehicle => "car",
2648
- :deep => {
2649
- :common => "junk",
2650
- :platform => "stuff",
2651
- :suite => "things"
2574
+ name: "busser",
2575
+ version: "suitey",
2576
+ color: "purple",
2577
+ fruit: ["banana"],
2578
+ vehicle: "car",
2579
+ deep: {
2580
+ common: "junk",
2581
+ platform: "stuff",
2582
+ suite: "things",
2652
2583
  }
2653
2584
  )
2654
2585
  end
@@ -2656,32 +2587,32 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
2656
2587
  it "platform into common" do
2657
2588
  DataMunger.new(
2658
2589
  {
2659
- :busser => {
2660
- :version => "commony",
2661
- :color => "purple",
2662
- :fruit => %w[apple pear],
2663
- :deep => { :common => "junk" }
2590
+ busser: {
2591
+ version: "commony",
2592
+ color: "purple",
2593
+ fruit: %w{apple pear},
2594
+ deep: { common: "junk" },
2664
2595
  },
2665
- :platforms => [
2596
+ platforms: [
2666
2597
  {
2667
- :name => "plat",
2668
- :busser => {
2669
- :version => "platformy",
2670
- :fruit => ["banana"],
2671
- :deep => { :platform => "stuff" }
2672
- }
2673
- }
2674
- ]
2598
+ name: "plat",
2599
+ busser: {
2600
+ version: "platformy",
2601
+ fruit: ["banana"],
2602
+ deep: { platform: "stuff" },
2603
+ },
2604
+ },
2605
+ ],
2675
2606
  },
2676
2607
  {}
2677
2608
  ).verifier_data_for("sweet", "plat").must_equal(
2678
- :name => "busser",
2679
- :version => "platformy",
2680
- :color => "purple",
2681
- :fruit => ["banana"],
2682
- :deep => {
2683
- :common => "junk",
2684
- :platform => "stuff"
2609
+ name: "busser",
2610
+ version: "platformy",
2611
+ color: "purple",
2612
+ fruit: ["banana"],
2613
+ deep: {
2614
+ common: "junk",
2615
+ platform: "stuff",
2685
2616
  }
2686
2617
  )
2687
2618
  end
@@ -2689,33 +2620,33 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
2689
2620
  it "suite into common" do
2690
2621
  DataMunger.new(
2691
2622
  {
2692
- :busser => {
2693
- :version => "commony",
2694
- :color => "purple",
2695
- :fruit => %w[apple pear],
2696
- :deep => { :common => "junk" }
2623
+ busser: {
2624
+ version: "commony",
2625
+ color: "purple",
2626
+ fruit: %w{apple pear},
2627
+ deep: { common: "junk" },
2697
2628
  },
2698
- :suites => [
2629
+ suites: [
2699
2630
  {
2700
- :name => "sweet",
2701
- :busser => {
2702
- :version => "suitey",
2703
- :vehicle => "car",
2704
- :deep => { :suite => "things" }
2705
- }
2706
- }
2707
- ]
2631
+ name: "sweet",
2632
+ busser: {
2633
+ version: "suitey",
2634
+ vehicle: "car",
2635
+ deep: { suite: "things" },
2636
+ },
2637
+ },
2638
+ ],
2708
2639
  },
2709
2640
  {}
2710
2641
  ).verifier_data_for("sweet", "plat").must_equal(
2711
- :name => "busser",
2712
- :version => "suitey",
2713
- :color => "purple",
2714
- :fruit => %w[apple pear],
2715
- :vehicle => "car",
2716
- :deep => {
2717
- :common => "junk",
2718
- :suite => "things"
2642
+ name: "busser",
2643
+ version: "suitey",
2644
+ color: "purple",
2645
+ fruit: %w{apple pear},
2646
+ vehicle: "car",
2647
+ deep: {
2648
+ common: "junk",
2649
+ suite: "things",
2719
2650
  }
2720
2651
  )
2721
2652
  end
@@ -2723,36 +2654,36 @@ module Kitchen # rubocop:disable Metrics/ModuleLength
2723
2654
  it "suite into platform" do
2724
2655
  DataMunger.new(
2725
2656
  {
2726
- :platforms => [
2657
+ platforms: [
2727
2658
  {
2728
- :name => "plat",
2729
- :busser => {
2730
- :version => "platformy",
2731
- :fruit => ["banana"],
2732
- :deep => { :platform => "stuff" }
2733
- }
2734
- }
2659
+ name: "plat",
2660
+ busser: {
2661
+ version: "platformy",
2662
+ fruit: ["banana"],
2663
+ deep: { platform: "stuff" },
2664
+ },
2665
+ },
2735
2666
  ],
2736
- :suites => [
2667
+ suites: [
2737
2668
  {
2738
- :name => "sweet",
2739
- :busser => {
2740
- :version => "suitey",
2741
- :vehicle => "car",
2742
- :deep => { :suite => "things" }
2743
- }
2744
- }
2745
- ]
2669
+ name: "sweet",
2670
+ busser: {
2671
+ version: "suitey",
2672
+ vehicle: "car",
2673
+ deep: { suite: "things" },
2674
+ },
2675
+ },
2676
+ ],
2746
2677
  },
2747
2678
  {}
2748
2679
  ).verifier_data_for("sweet", "plat").must_equal(
2749
- :name => "busser",
2750
- :version => "suitey",
2751
- :fruit => ["banana"],
2752
- :vehicle => "car",
2753
- :deep => {
2754
- :platform => "stuff",
2755
- :suite => "things"
2680
+ name: "busser",
2681
+ version: "suitey",
2682
+ fruit: ["banana"],
2683
+ vehicle: "car",
2684
+ deep: {
2685
+ platform: "stuff",
2686
+ suite: "things",
2756
2687
  }
2757
2688
  )
2758
2689
  end