test-kitchen 1.23.3 → 1.23.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kitchen/version.rb +1 -1
  3. data/support/chef-client-zero.rb +1 -1
  4. metadata +5 -324
  5. data/.gitattributes +0 -3
  6. data/.github/ISSUE_TEMPLATE.md +0 -56
  7. data/.github/lock.yml +0 -1
  8. data/.gitignore +0 -38
  9. data/.gitmodules +0 -0
  10. data/.kitchen.appveyor.yml +0 -25
  11. data/.kitchen.dokken.yml +0 -31
  12. data/.kitchen.proxy.yml +0 -27
  13. data/.rubocop.yml +0 -5
  14. data/.travis.yml +0 -57
  15. data/.yardopts +0 -3
  16. data/Berksfile +0 -3
  17. data/CHANGELOG.md +0 -1510
  18. data/CONTRIBUTING.md +0 -14
  19. data/ECOSYSTEM.md +0 -93
  20. data/Gemfile +0 -40
  21. data/Gemfile.proxy_tests +0 -4
  22. data/Guardfile +0 -42
  23. data/MAINTAINERS.md +0 -29
  24. data/README.md +0 -138
  25. data/RELEASE_NOTES.md +0 -167
  26. data/Rakefile +0 -77
  27. data/appveyor.yml +0 -47
  28. data/docs/CONTRIBUTING.md +0 -8
  29. data/docs/LICENSE +0 -22
  30. data/docs/README.md +0 -78
  31. data/docs/archetypes/default.md +0 -6
  32. data/docs/config.toml +0 -36
  33. data/docs/content/docs/_index.md +0 -5
  34. data/docs/content/docs/drivers/_index.md +0 -27
  35. data/docs/content/docs/drivers/azurerm.md +0 -44
  36. data/docs/content/docs/drivers/vagrant.md +0 -39
  37. data/docs/content/docs/getting-started/00-introduction.md +0 -14
  38. data/docs/content/docs/getting-started/01-installing.md +0 -64
  39. data/docs/content/docs/getting-started/02-getting-help.md +0 -59
  40. data/docs/content/docs/getting-started/03-creating-cookbook.md +0 -46
  41. data/docs/content/docs/getting-started/04-kitchen-yml.md +0 -56
  42. data/docs/content/docs/getting-started/05-instances.md +0 -79
  43. data/docs/content/docs/getting-started/06-writing-recipe.md +0 -21
  44. data/docs/content/docs/getting-started/07-running-converge.md +0 -134
  45. data/docs/content/docs/getting-started/08-manually-verifying.md +0 -55
  46. data/docs/content/docs/getting-started/09-writing-test.md +0 -49
  47. data/docs/content/docs/getting-started/10-running-verify.md +0 -120
  48. data/docs/content/docs/getting-started/11-running-test.md +0 -168
  49. data/docs/content/docs/getting-started/12-adding-platform.md +0 -206
  50. data/docs/content/docs/getting-started/13-adding-feature.md +0 -30
  51. data/docs/content/docs/getting-started/14-adding-suite.md +0 -60
  52. data/docs/content/docs/getting-started/15-adding-test.md +0 -66
  53. data/docs/content/docs/getting-started/16-adding-recipe.md +0 -53
  54. data/docs/content/docs/getting-started/17-excluding-platforms.md +0 -101
  55. data/docs/content/docs/getting-started/18-next-steps.md +0 -23
  56. data/docs/content/docs/getting-started/_index.md +0 -5
  57. data/docs/content/docs/provisioners/_index.md +0 -36
  58. data/docs/content/docs/provisioners/chef.md +0 -69
  59. data/docs/content/docs/provisioners/shell.md +0 -31
  60. data/docs/content/docs/reference/_index.md +0 -5
  61. data/docs/content/docs/reference/configuration.md +0 -53
  62. data/docs/content/docs/reference/examples.md +0 -97
  63. data/docs/content/docs/reference/faq.md +0 -58
  64. data/docs/content/docs/reference/fixtures.md +0 -32
  65. data/docs/content/docs/reference/glossary.md +0 -34
  66. data/docs/content/docs/reference/lifecycle-hooks.md +0 -68
  67. data/docs/content/docs/reference/reboots.md +0 -24
  68. data/docs/content/docs/verifiers/_index.md +0 -14
  69. data/docs/content/docs/verifiers/inspec.md +0 -44
  70. data/docs/content/docs/verifiers/serverspec.md +0 -20
  71. data/docs/static/images/chef-logo.png +0 -0
  72. data/docs/static/images/chef-logo.svg +0 -1
  73. data/docs/static/images/github-banner.png +0 -0
  74. data/docs/static/images/github-banner.svg +0 -71
  75. data/docs/static/images/kitchen-logo.png +0 -0
  76. data/docs/static/images/logo-block.svg +0 -222
  77. data/docs/static/images/logo.png +0 -0
  78. data/docs/static/images/logos-group.png +0 -0
  79. data/docs/static/images/terminal-1.png +0 -0
  80. data/docs/static/images/terminal-1.svg +0 -589
  81. data/docs/static/images/terminal-2.png +0 -0
  82. data/docs/static/images/terminal-2.svg +0 -235
  83. data/docs/static/images/terminal-3.png +0 -0
  84. data/docs/static/images/terminal-3.svg +0 -439
  85. data/docs/static/index.html +0 -59
  86. data/docs/static/javascripts/all.js +0 -348
  87. data/docs/static/javascripts/vendor/foundation.min.js +0 -4
  88. data/docs/static/javascripts/vendor/jquery.min.js +0 -5
  89. data/docs/static/javascripts/vendor/what-input.js +0 -336
  90. data/docs/static/stylesheets/site.css +0 -4667
  91. data/docs/themes/kitchen/layouts/_default/baseof.html +0 -53
  92. data/docs/themes/kitchen/layouts/_default/list.html +0 -4
  93. data/docs/themes/kitchen/layouts/_default/redirect.html +0 -10
  94. data/docs/themes/kitchen/layouts/_default/single.html +0 -6
  95. data/docs/themes/kitchen/layouts/partials/core/head.html +0 -6
  96. data/docs/themes/kitchen/layouts/partials/kitchen/footer.html +0 -18
  97. data/docs/themes/kitchen/layouts/partials/kitchen/head.html +0 -4
  98. data/docs/themes/kitchen/layouts/partials/kitchen/header.html +0 -26
  99. data/docs/themes/kitchen/layouts/partials/search-docs.html +0 -3
  100. data/docs/themes/kitchen/layouts/partials/sidebar.html +0 -33
  101. data/docs/themes/kitchen/layouts/shortcodes/button.html +0 -1
  102. data/docs/themes/kitchen/layouts/shortcodes/codeblock.html +0 -8
  103. data/docs/themes/kitchen/layouts/shortcodes/cta.html +0 -5
  104. data/docs/themes/kitchen/layouts/shortcodes/danger.html +0 -1
  105. data/docs/themes/kitchen/layouts/shortcodes/example_fqdn.html +0 -1
  106. data/docs/themes/kitchen/layouts/shortcodes/info.html +0 -1
  107. data/docs/themes/kitchen/layouts/shortcodes/ol-styled.html +0 -3
  108. data/docs/themes/kitchen/layouts/shortcodes/success.html +0 -1
  109. data/docs/themes/kitchen/layouts/shortcodes/tip.html +0 -1
  110. data/docs/themes/kitchen/layouts/shortcodes/warning.html +0 -1
  111. data/docs/themes/kitchen/static/css/kitchen.css +0 -10
  112. data/docs/themes/kitchen/static/css/kitchen.css.map +0 -7
  113. data/docs/themes/kitchen/static/fonts/Muli-Bold.ttf +0 -0
  114. data/docs/themes/kitchen/static/fonts/Muli-Regular.ttf +0 -0
  115. data/docs/themes/kitchen/static/fonts/Muli-SemiBold.ttf +0 -0
  116. data/docs/themes/kitchen/static/fonts/fontawesome/fa-brands-400.eot +0 -0
  117. data/docs/themes/kitchen/static/fonts/fontawesome/fa-brands-400.svg +0 -1104
  118. data/docs/themes/kitchen/static/fonts/fontawesome/fa-brands-400.ttf +0 -0
  119. data/docs/themes/kitchen/static/fonts/fontawesome/fa-brands-400.woff +0 -0
  120. data/docs/themes/kitchen/static/fonts/fontawesome/fa-brands-400.woff2 +0 -0
  121. data/docs/themes/kitchen/static/fonts/fontawesome/fa-regular-400.eot +0 -0
  122. data/docs/themes/kitchen/static/fonts/fontawesome/fa-regular-400.svg +0 -372
  123. data/docs/themes/kitchen/static/fonts/fontawesome/fa-regular-400.ttf +0 -0
  124. data/docs/themes/kitchen/static/fonts/fontawesome/fa-regular-400.woff +0 -0
  125. data/docs/themes/kitchen/static/fonts/fontawesome/fa-regular-400.woff2 +0 -0
  126. data/docs/themes/kitchen/static/fonts/fontawesome/fa-solid-900.eot +0 -0
  127. data/docs/themes/kitchen/static/fonts/fontawesome/fa-solid-900.svg +0 -1896
  128. data/docs/themes/kitchen/static/fonts/fontawesome/fa-solid-900.ttf +0 -0
  129. data/docs/themes/kitchen/static/fonts/fontawesome/fa-solid-900.woff +0 -0
  130. data/docs/themes/kitchen/static/fonts/fontawesome/fa-solid-900.woff2 +0 -0
  131. data/docs/themes/kitchen/static/images/chef-logo-light.svg +0 -36
  132. data/docs/themes/kitchen/static/images/chef-logo-white.svg +0 -38
  133. data/docs/themes/kitchen/static/images/chef-logo.svg +0 -37
  134. data/docs/themes/kitchen/static/images/favicon.ico +0 -0
  135. data/docs/themes/kitchen/static/js/scripts-all.js +0 -7
  136. data/docs/themes/kitchen/static/js/source/chef-hugo.js +0 -116
  137. data/docs/themes/kitchen/static/js/source/omnitruck.js +0 -82
  138. data/docs/themes/kitchen/static/js/source/segment.js +0 -52
  139. data/docs/themes/kitchen/static/sass/_buttons.scss +0 -161
  140. data/docs/themes/kitchen/static/sass/_core.scss +0 -24
  141. data/docs/themes/kitchen/static/sass/_forms.scss +0 -14
  142. data/docs/themes/kitchen/static/sass/_mixins.scss +0 -133
  143. data/docs/themes/kitchen/static/sass/_typography.scss +0 -34
  144. data/docs/themes/kitchen/static/sass/_variables.scss +0 -82
  145. data/docs/themes/kitchen/static/sass/kitchen.scss +0 -7
  146. data/docs/themes/kitchen/static/sass/kitchen/_footer.scss +0 -50
  147. data/docs/themes/kitchen/static/sass/kitchen/_header.scss +0 -187
  148. data/docs/themes/kitchen/static/sass/kitchen/_homepage.scss +0 -27
  149. data/docs/themes/kitchen/static/sass/kitchen/_utility-bar.scss +0 -173
  150. data/docs/themes/kitchen/static/sass/partials/_alerts.scss +0 -32
  151. data/docs/themes/kitchen/static/sass/partials/_bg.scss +0 -19
  152. data/docs/themes/kitchen/static/sass/partials/_blurbs.scss +0 -25
  153. data/docs/themes/kitchen/static/sass/partials/_callout.scss +0 -15
  154. data/docs/themes/kitchen/static/sass/partials/_cards.scss +0 -54
  155. data/docs/themes/kitchen/static/sass/partials/_dropdown.scss +0 -77
  156. data/docs/themes/kitchen/static/sass/partials/_grid.scss +0 -87
  157. data/docs/themes/kitchen/static/sass/partials/_padding.scss +0 -73
  158. data/docs/themes/kitchen/static/sass/partials/_sidebar.scss +0 -71
  159. data/docs/themes/kitchen/static/sass/partials/_tabs.scss +0 -125
  160. data/docs/themes/kitchen/static/sass/typography/_chroma.scss +0 -366
  161. data/docs/themes/kitchen/static/sass/typography/_code.scss +0 -72
  162. data/docs/themes/kitchen/static/sass/typography/_headers.scss +0 -90
  163. data/docs/themes/kitchen/static/sass/typography/_links.scss +0 -127
  164. data/docs/themes/kitchen/static/sass/typography/_lists.scss +0 -155
  165. data/docs/themes/kitchen/static/sass/typography/_prose.scss +0 -29
  166. data/docs/themes/kitchen/static/sass/typography/_text.scss +0 -221
  167. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_animated.scss +0 -20
  168. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_bordered-pulled.scss +0 -20
  169. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_core.scss +0 -16
  170. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_fixed-width.scss +0 -6
  171. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_icons.scss +0 -992
  172. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_larger.scss +0 -23
  173. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_list.scss +0 -18
  174. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_mixins.scss +0 -57
  175. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_rotated-flipped.scss +0 -23
  176. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_screen-reader.scss +0 -5
  177. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_stacked.scss +0 -31
  178. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_variables.scss +0 -1005
  179. data/docs/themes/kitchen/static/sass/vendor/fontawesome/fa-brands.scss +0 -21
  180. data/docs/themes/kitchen/static/sass/vendor/fontawesome/fa-regular.scss +0 -22
  181. data/docs/themes/kitchen/static/sass/vendor/fontawesome/fa-solid.scss +0 -23
  182. data/docs/themes/kitchen/static/sass/vendor/fontawesome/fontawesome.scss +0 -16
  183. data/docs/themes/kitchen/theme.toml +0 -8
  184. data/features/kitchen_action_commands.feature +0 -164
  185. data/features/kitchen_command.feature +0 -16
  186. data/features/kitchen_console_command.feature +0 -35
  187. data/features/kitchen_defaults.feature +0 -38
  188. data/features/kitchen_diagnose_command.feature +0 -96
  189. data/features/kitchen_help_command.feature +0 -16
  190. data/features/kitchen_init_command.feature +0 -254
  191. data/features/kitchen_list_command.feature +0 -140
  192. data/features/kitchen_login_command.feature +0 -62
  193. data/features/kitchen_sink_command.feature +0 -30
  194. data/features/kitchen_test_command.feature +0 -88
  195. data/features/step_definitions/gem_steps.rb +0 -24
  196. data/features/step_definitions/git_steps.rb +0 -5
  197. data/features/step_definitions/output_steps.rb +0 -5
  198. data/features/support/env.rb +0 -74
  199. data/spec/kitchen/base64_stream_spec.rb +0 -74
  200. data/spec/kitchen/cli_spec.rb +0 -54
  201. data/spec/kitchen/collection_spec.rb +0 -76
  202. data/spec/kitchen/color_spec.rb +0 -51
  203. data/spec/kitchen/config_spec.rb +0 -434
  204. data/spec/kitchen/configurable_spec.rb +0 -1113
  205. data/spec/kitchen/data_munger_spec.rb +0 -2800
  206. data/spec/kitchen/diagnostic_spec.rb +0 -128
  207. data/spec/kitchen/driver/base_spec.rb +0 -132
  208. data/spec/kitchen/driver/dummy_spec.rb +0 -193
  209. data/spec/kitchen/driver/exec_spec.rb +0 -75
  210. data/spec/kitchen/driver/proxy_spec.rb +0 -127
  211. data/spec/kitchen/driver/ssh_base_spec.rb +0 -1136
  212. data/spec/kitchen/driver_spec.rb +0 -106
  213. data/spec/kitchen/errors_spec.rb +0 -317
  214. data/spec/kitchen/instance_spec.rb +0 -1372
  215. data/spec/kitchen/lazy_hash_spec.rb +0 -113
  216. data/spec/kitchen/lifecycle_hooks_spec.rb +0 -171
  217. data/spec/kitchen/loader/yaml_spec.rb +0 -787
  218. data/spec/kitchen/logger_spec.rb +0 -425
  219. data/spec/kitchen/logging_spec.rb +0 -56
  220. data/spec/kitchen/login_command_spec.rb +0 -67
  221. data/spec/kitchen/metadata_chopper_spec.rb +0 -79
  222. data/spec/kitchen/platform_spec.rb +0 -88
  223. data/spec/kitchen/provisioner/base_spec.rb +0 -393
  224. data/spec/kitchen/provisioner/chef/policyfile_spec.rb +0 -140
  225. data/spec/kitchen/provisioner/chef_apply_spec.rb +0 -131
  226. data/spec/kitchen/provisioner/chef_base_spec.rb +0 -1565
  227. data/spec/kitchen/provisioner/chef_solo_spec.rb +0 -602
  228. data/spec/kitchen/provisioner/chef_zero_spec.rb +0 -1013
  229. data/spec/kitchen/provisioner/dummy_spec.rb +0 -96
  230. data/spec/kitchen/provisioner/shell_spec.rb +0 -623
  231. data/spec/kitchen/provisioner_spec.rb +0 -101
  232. data/spec/kitchen/shell_out_spec.rb +0 -146
  233. data/spec/kitchen/ssh_spec.rb +0 -584
  234. data/spec/kitchen/state_file_spec.rb +0 -122
  235. data/spec/kitchen/suite_spec.rb +0 -61
  236. data/spec/kitchen/transport/base_spec.rb +0 -140
  237. data/spec/kitchen/transport/exec_spec.rb +0 -79
  238. data/spec/kitchen/transport/ssh_spec.rb +0 -1317
  239. data/spec/kitchen/transport/winrm_spec.rb +0 -1320
  240. data/spec/kitchen/transport_spec.rb +0 -106
  241. data/spec/kitchen/util_spec.rb +0 -250
  242. data/spec/kitchen/verifier/base_spec.rb +0 -346
  243. data/spec/kitchen/verifier/busser_spec.rb +0 -580
  244. data/spec/kitchen/verifier/dummy_spec.rb +0 -96
  245. data/spec/kitchen/verifier/shell_spec.rb +0 -157
  246. data/spec/kitchen/verifier_spec.rb +0 -114
  247. data/spec/kitchen_spec.rb +0 -112
  248. data/spec/spec_helper.rb +0 -110
  249. data/spec/support/powershell_max_size_spec.rb +0 -39
  250. data/test-kitchen.gemspec +0 -49
  251. data/test/cookbooks/test_cookbook/metadata.rb +0 -6
  252. data/test/cookbooks/test_cookbook/recipes/default.rb +0 -1
  253. data/test/integration/default/default_spec.rb +0 -3
  254. data/testing_windows.md +0 -38
@@ -1,30 +0,0 @@
1
- Feature: The `kitchen sink` command
2
- In order to have fun and provide an Easter Egg for users
3
- As a Test Kitchen user
4
- I want a `sink` command that displays ASCII art
5
-
6
- Scenario: Displaying help
7
- When I run `kitchen help`
8
- Then the exit status should be 0
9
- And the output should not contain "kitchen sink"
10
-
11
- Scenario: Displaying the sink
12
- When I run `kitchen sink`
13
- Then the exit status should be 0
14
- And the output should contain:
15
- """
16
- ___
17
- ' _ '.
18
- / /` `\ \
19
- | | [__]
20
- | | {{
21
- | | }}
22
- _ | | _ {{
23
- ___________<_>_| |_<_>}}________
24
- .=======^=(___)=^={{====.
25
- / .----------------}}---. \
26
- / / {{ \ \
27
- / / }} \ \
28
- ( '=========================' )
29
- '-----------------------------'
30
- """
@@ -1,88 +0,0 @@
1
- Feature: Running a full test instance test
2
- In order to "fire-and-forget" or run help setup a CI job
3
- As an operator or CI script
4
- I want to run a command that will fully test one or more instances
5
-
6
- Background:
7
- Given a file named ".kitchen.yml" with:
8
- """
9
- ---
10
- driver:
11
- name: dummy
12
-
13
- provisioner:
14
- name: dummy
15
-
16
- platforms:
17
- - name: cool
18
- - name: beans
19
-
20
- suites:
21
- - name: client
22
- - name: server
23
- """
24
-
25
- @spawn
26
- Scenario: Running a single instance
27
- When I run `kitchen test client-beans`
28
- Then the output should contain "Starting Kitchen"
29
- Then the output should contain "Cleaning up any prior instances of <client-beans>"
30
- Then the output should contain "Testing <client-beans>"
31
- Then the output should contain "Finished testing <client-beans>"
32
- Then the output should contain "Kitchen is finished."
33
- And the exit status should be 0
34
-
35
- @spawn
36
- Scenario: Running a single instance never destroying an instance
37
- When I successfully run `kitchen test client-beans --destroy=never`
38
- And I successfully run `kitchen list client-beans`
39
- Then the output should match /^client-beans\s+.+\s+Verified\s+\<None\>$/
40
-
41
- @spawn
42
- Scenario: Running a single instance always destroying an instance
43
- Given a file named ".kitchen.local.yml" with:
44
- """
45
- ---
46
- provisioner:
47
- fail: true
48
- """
49
- When I run `kitchen test client-beans --destroy=always`
50
- Then the exit status should not be 0
51
- When I successfully run `kitchen list client-beans`
52
- Then the output should match /^client-beans\s+.+\s+\<Not Created\>\s+\<None\>$/
53
-
54
- @spawn
55
- Scenario: Running a single instance not destroying an instance on failure
56
- Given a file named ".kitchen.local.yml" with:
57
- """
58
- ---
59
- provisioner:
60
- fail: true
61
- """
62
- When I run `kitchen test client-beans --destroy=passing`
63
- Then the exit status should not be 0
64
- When I successfully run `kitchen list client-beans`
65
- Then the output should match /^client-beans\s+.+\s+Created\s+Kitchen::ActionFailed$/
66
-
67
- @spawn
68
- Scenario: Running a single instance destroying an instance on success
69
- When I run `kitchen test client-beans --destroy=passing`
70
- Then the exit status should be 0
71
- When I successfully run `kitchen list client-beans`
72
- Then the output should match /^client-beans\s+.+\s+\<Not Created\>\s+\<None\>$/
73
-
74
- @spawn
75
- Scenario: Running all instances
76
- When I run `kitchen test`
77
- Then the output should contain "Starting Kitchen"
78
- Then the output should contain "Finished testing <client-cool>"
79
- Then the output should contain "Finished testing <client-beans>"
80
- Then the output should contain "Finished testing <server-cool>"
81
- Then the output should contain "Finished testing <server-beans>"
82
- Then the output should contain "Kitchen is finished."
83
- And the exit status should be 0
84
- When I successfully run `kitchen list`
85
- Then the output should match /^client-cool\s+.+\s+\<Not Created\>\s+\<None\>$/
86
- Then the output should match /^client-beans\s+.+\s+\<Not Created\>\s+\<None\>$/
87
- Then the output should match /^server-cool\s+.+\s+\<Not Created\>\s+\<None\>$/
88
- Then the output should match /^server-beans\s+.+\s+\<Not Created\>\s+\<None\>$/
@@ -1,24 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- require "tmpdir"
4
- require "pathname"
5
-
6
- Then(/^a gem named "(.*?)" is installed with version "(.*?)"$/) do |name, version|
7
- unbundlerize do
8
- run_simple(
9
- sanitize_text("gem list #{name} --version #{version} -i"),
10
- fail_on_error: true,
11
- exit_timeout: nil
12
- )
13
- end
14
- end
15
-
16
- Then(/^a gem named "(.*?)" is installed$/) do |name|
17
- unbundlerize do
18
- run_simple(
19
- sanitize_text("gem list #{name} -i"),
20
- fail_on_error: true,
21
- exit_timeout: nil
22
- )
23
- end
24
- end
@@ -1,5 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Given(/I have a git repository/) do
4
- create_directory(".git")
5
- end
@@ -1,5 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Then(/^the stdout should match \/([^\/]*)\/$/) do |expected|
4
- expect(last_command_started).to have_output_on_stdout(Regexp.new(expected))
5
- end
@@ -1,74 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- # Set up the environment for testing
4
- require "aruba/cucumber"
5
- require "aruba/in_process"
6
- require "aruba/spawn_process"
7
- require "kitchen"
8
- require "kitchen/cli"
9
-
10
- class ArubaHelper
11
- def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel)
12
- @argv = argv
13
- @stdin = stdin
14
- @stdout = stdout
15
- @stderr = stderr
16
- @kernel = kernel
17
- end
18
-
19
- def execute!
20
- $stdout = @stdout
21
- $stdin = @stdin
22
-
23
- kitchen_cli = Kitchen::CLI
24
- kitchen_cli.start(@argv)
25
- @kernel.exit(0)
26
- end
27
- end
28
-
29
- Before do
30
- @aruba_timeout_seconds = 15
31
- @cleanup_dirs = []
32
-
33
- aruba.config.command_launcher = :in_process
34
- aruba.config.main_class = ArubaHelper
35
- end
36
-
37
- Before("@spawn") do
38
- aruba.config.command_launcher = :spawn
39
- end
40
-
41
- After do |s|
42
- # Tell Cucumber to quit after this scenario is done - if it failed.
43
- # This is useful to inspect the 'tmp/aruba' directory before any other
44
- # steps are executed and clear it out.
45
- Cucumber.wants_to_quit = true if s.failed?
46
-
47
- # Restore environment variables to their original settings, if they have
48
- # been saved off
49
- env = aruba.environment
50
- env.to_h.keys.select { |key| key =~ /^_CUKE_/ }
51
- .each do |backup_key|
52
- env[backup_key.sub(/^_CUKE_/, "")] = env[backup_key]
53
- env.delete(backup_key)
54
- end
55
-
56
- @cleanup_dirs.each { |dir| FileUtils.rm_rf(dir) }
57
- end
58
-
59
- def backup_envvar(key)
60
- aruba.environment["_CUKE_#{key}"] = aruba.environment[key]
61
- end
62
-
63
- def restore_envvar(key)
64
- aruba.environment[key] = aruba.environment["_CUKE_#{key}"]
65
- aruba.environment.delete("_CUKE_#{key}")
66
- end
67
-
68
- def unbundlerize
69
- keys = %w{BUNDLER_EDITOR BUNDLE_BIN_PATH BUNDLE_GEMFILE RUBYOPT}
70
-
71
- keys.each { |key| backup_envvar(key); aruba.environment.delete(key) }
72
- yield
73
- keys.each { |key| restore_envvar(key) }
74
- end
@@ -1,74 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- #
3
- # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
- #
5
- # Copyright (C) 2014, Fletcher Nichol
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
-
19
- require_relative "../spec_helper"
20
- require "base64"
21
- require "stringio"
22
- require "securerandom"
23
-
24
- require "kitchen/base64_stream"
25
-
26
- describe Kitchen::Base64Stream do
27
- SHORT_BODIES = %w{you test wakkawakkawakka}.freeze
28
-
29
- describe ".strict_encode" do
30
- SHORT_BODIES.each do |body|
31
- it "encodes short payload ('#{body}') from input IO to output IO" do
32
- output = StringIO.new("", "wb")
33
- StringIO.open(body) do |input|
34
- Kitchen::Base64Stream.strict_encode(input, output)
35
- end
36
-
37
- output.string.must_equal Base64.strict_encode64(body)
38
- end
39
- end
40
-
41
- it "encodes a large payload from input IO to output IO" do
42
- body = SecureRandom.random_bytes(1_048_576 * 8)
43
- output = StringIO.new("", "wb")
44
- StringIO.open(body) do |input|
45
- Kitchen::Base64Stream.strict_encode(input, output)
46
- end
47
-
48
- output.string.must_equal Base64.strict_encode64(body)
49
- end
50
- end
51
-
52
- describe ".strict_decode" do
53
- SHORT_BODIES.map { |b| Base64.strict_encode64(b) }.each do |body|
54
- it "decodes short payload ('#{body}') from input IO to output IO" do
55
- output = StringIO.new("", "wb")
56
- StringIO.open(body) do |input|
57
- Kitchen::Base64Stream.strict_decode(input, output)
58
- end
59
-
60
- output.string.must_equal Base64.strict_decode64(body)
61
- end
62
- end
63
-
64
- it "decodes a large payload from input IO to output IO" do
65
- body = Base64.strict_encode64(SecureRandom.hex(1_048_576 * 8))
66
- output = StringIO.new("", "wb")
67
- StringIO.open(body) do |input|
68
- Kitchen::Base64Stream.strict_decode(input, output)
69
- end
70
-
71
- output.string.must_equal Base64.strict_decode64(body)
72
- end
73
- end
74
- end
@@ -1,54 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- #
3
- # Author:: Tyler Ball (<tball@chef.io>)
4
- #
5
- # Copyright (C) 2015, Fletcher Nichol
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
-
19
- require_relative "../spec_helper"
20
-
21
- require "kitchen/cli"
22
- require "kitchen"
23
-
24
- module Kitchen
25
- describe CLI do
26
- let(:cli) { CLI.new }
27
-
28
- before do
29
- @orig_env = ENV.to_hash
30
- end
31
-
32
- after do
33
- ENV.clear
34
- @orig_env.each do |k, v|
35
- ENV[k] = v
36
- end
37
- end
38
-
39
- describe "#initialize" do
40
- it "does not set logging config when environment variables are missing" do
41
- assert_equal Kitchen::DEFAULT_LOG_LEVEL, cli.config.log_level
42
- assert_equal Kitchen::DEFAULT_LOG_OVERWRITE, cli.config.log_overwrite
43
- end
44
-
45
- it "does set logging config when environment variables are present" do
46
- ENV["KITCHEN_LOG"] = "warn"
47
- ENV["KITCHEN_LOG_OVERWRITE"] = "false"
48
-
49
- assert_equal :warn, cli.config.log_level
50
- assert_equal false, cli.config.log_overwrite
51
- end
52
- end
53
- end
54
- end
@@ -1,76 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- #
3
- # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
- #
5
- # Copyright (C) 2012, Fletcher Nichol
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
-
19
- require_relative "../spec_helper"
20
- require "ostruct"
21
-
22
- require "kitchen/collection"
23
-
24
- describe Kitchen::Collection do
25
- let(:collection) do
26
- Kitchen::Collection.new([
27
- obj("one"), obj("two", "a"), obj("two", "b"), obj("three")
28
- ])
29
- end
30
-
31
- it "transparently wraps an Array" do
32
- collection.must_be_instance_of Array
33
- end
34
-
35
- describe "#get" do
36
- it "returns a single object by its name" do
37
- collection.get("three").must_equal obj("three")
38
- end
39
-
40
- it "returns the first occurance of an object by its name" do
41
- collection.get("two").must_equal obj("two", "a")
42
- end
43
-
44
- it "returns nil if an object cannot be found by its name" do
45
- collection.get("nope").must_be_nil
46
- end
47
- end
48
-
49
- describe "#get_all" do
50
- it "returns a Collection of objects whose name matches the regex" do
51
- result = collection.get_all(/(one|three)/)
52
- result.size.must_equal 2
53
- result[0].must_equal obj("one")
54
- result[1].must_equal obj("three")
55
- result.get_all(/one/).size.must_equal 1
56
- end
57
-
58
- it "returns an empty Collection if no matches are found" do
59
- result = collection.get_all(/noppa/)
60
- result.must_equal []
61
- result.get("nahuh").must_be_nil
62
- end
63
- end
64
-
65
- describe "#as_name" do
66
- it "returns an Array of names as strings" do
67
- collection.as_names.must_equal %w{one two two three}
68
- end
69
- end
70
-
71
- private
72
-
73
- def obj(name, extra = nil)
74
- OpenStruct.new(name: name, extra: extra)
75
- end
76
- end
@@ -1,51 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- #
3
- # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
- #
5
- # Copyright (C) 2013, Fletcher Nichol
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
-
19
- require_relative "../spec_helper"
20
-
21
- require "kitchen/color"
22
-
23
- describe Kitchen::Color do
24
- describe ".escape" do
25
- it "returns an empty string if name is nil" do
26
- Kitchen::Color.escape(nil).must_equal ""
27
- end
28
-
29
- it "returns an empty string if name is not in the ANSI hash" do
30
- Kitchen::Color.escape(:puce).must_equal ""
31
- end
32
-
33
- it "returns an ansi escape sequence string for cyan" do
34
- Kitchen::Color.escape(:cyan).must_equal "\e[36m"
35
- end
36
-
37
- it "returns an ansi escape sequence string for reset" do
38
- Kitchen::Color.escape(:reset).must_equal "\e[0m"
39
- end
40
- end
41
-
42
- describe ".colorize" do
43
- it "returns an ansi escaped string colored yellow" do
44
- Kitchen::Color.colorize("hello", :yellow).must_equal "\e[33mhello\e[0m"
45
- end
46
-
47
- it "returns an unescaped string if color is not in the ANSI hash" do
48
- Kitchen::Color.colorize("double", :rainbow).must_equal "double"
49
- end
50
- end
51
- end