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,580 +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
-
21
- require "kitchen"
22
- require "kitchen/verifier/busser"
23
-
24
- describe Kitchen::Verifier::Busser do
25
- let(:logged_output) { StringIO.new }
26
- let(:logger) { Logger.new(logged_output) }
27
- let(:config) { Hash.new }
28
- let(:platform) { stub(os_type: nil, shell_type: nil) }
29
- let(:suite) { stub(name: "germany") }
30
-
31
- let(:instance) do
32
- stub(
33
- name: "coolbeans",
34
- logger: logger,
35
- platform: platform,
36
- suite: suite,
37
- to_str: "instance"
38
- )
39
- end
40
-
41
- let(:verifier) do
42
- Kitchen::Verifier::Busser.new(config).finalize_config!(instance)
43
- end
44
-
45
- let(:files) do
46
- {
47
- "mondospec/charlie" => {
48
- content: "charlie",
49
- perms: (running_tests_on_windows? ? "0644" : "0764"),
50
- },
51
- "minispec/beta" => {
52
- content: "beta",
53
- perms: "0644",
54
- },
55
- "abba/alpha" => {
56
- content: "alpha",
57
- perms: (running_tests_on_windows? ? "0444" : "0440"),
58
- },
59
- }
60
- end
61
-
62
- let(:helper_files) do
63
- {
64
- "minispec/spec_helper" => {
65
- content: "helping",
66
- perms: "0644",
67
- },
68
- "abba/common" => {
69
- content: "yeppers",
70
- perms: (running_tests_on_windows? ? "0644" : "0664"),
71
- },
72
- }
73
- end
74
-
75
- before do
76
- @root = Dir.mktmpdir
77
- config[:test_base_path] = @root
78
- end
79
-
80
- after do
81
- FileUtils.remove_entry(@root)
82
- end
83
-
84
- # TODO: deal with this:
85
- # it "raises a UserError if the suite name is 'helper'" do
86
- # proc {
87
- # Kitchen::Busser.new("helper", config)
88
- # }.must_raise Kitchen::UserError
89
- # end
90
-
91
- it "verifier api_version is 1" do
92
- verifier.diagnose_plugin[:api_version].must_equal 1
93
- end
94
-
95
- it "plugin_version is set to Kitchen::VERSION" do
96
- verifier.diagnose_plugin[:version].must_equal Kitchen::VERSION
97
- end
98
-
99
- describe "configuration" do
100
- describe "for unix operating systems" do
101
- before do
102
- platform.stubs(:os_type).returns("unix")
103
- end
104
-
105
- it ":ruby_bindir defaults the an Omnibus Chef installation" do
106
- verifier[:ruby_bindir].must_equal "/opt/chef/embedded/bin"
107
- end
108
-
109
- it ":busser_bin defaults to a binstub under :root_path" do
110
- config[:root_path] = "/beep"
111
-
112
- verifier[:busser_bin].must_equal "/beep/bin/busser"
113
- end
114
- end
115
-
116
- describe "for windows operating systems" do
117
- before { platform.stubs(:os_type).returns("windows") }
118
-
119
- it ":ruby_bindir defaults the an Omnibus Chef installation" do
120
- verifier[:ruby_bindir]
121
- .must_equal '$env:systemdrive\\opscode\\chef\\embedded\\bin'
122
- end
123
-
124
- it ":busser_bin defaults to a binstub under :root_path" do
125
- config[:root_path] = '\\beep'
126
-
127
- verifier[:busser_bin].must_equal '\\beep\\bin\\busser.bat'
128
- end
129
- end
130
-
131
- it ":version defaults to 'busser'" do
132
- verifier[:version].must_equal "busser"
133
- end
134
- end
135
-
136
- def self.common_bourne_variable_specs
137
- it "uses bourne shell" do
138
- cmd.must_match(/\Ash -c '$/)
139
- cmd.must_match(/'\Z/)
140
- end
141
-
142
- it "ends with a single quote" do
143
- cmd.must_match(/'\Z/)
144
- end
145
-
146
- it "sets the BUSSER_ROOT environment variable" do
147
- cmd.must_match regexify(%{BUSSER_ROOT="/r"; export BUSSER_ROOT})
148
- end
149
-
150
- it "sets the GEM_HOME environment variable" do
151
- cmd.must_match regexify(%{GEM_HOME="/r/gems"; export GEM_HOME})
152
- end
153
-
154
- it "sets the GEM_PATH environment variable" do
155
- cmd.must_match regexify(%{GEM_PATH="/r/gems"; export GEM_PATH})
156
- end
157
-
158
- it "sets the GEM_CACHE environment variable" do
159
- cmd.must_match regexify(%{GEM_CACHE="/r/gems/cache"; export GEM_CACHE})
160
- end
161
- end
162
-
163
- def self.common_powershell_variable_specs
164
- it "sets the BUSSER_ROOT environment variable" do
165
- cmd.must_match regexify(%{$env:BUSSER_ROOT = "\\r"})
166
- end
167
-
168
- it "sets the GEM_HOME environment variable" do
169
- cmd.must_match regexify(%{$env:GEM_HOME = "\\r\\gems"})
170
- end
171
-
172
- it "sets the GEM_PATH environment variable" do
173
- cmd.must_match regexify(%{$env:GEM_PATH = "\\r\\gems"})
174
- end
175
-
176
- it "sets the GEM_CACHE environment variable" do
177
- cmd.must_match regexify(%{$env:GEM_CACHE = "\\r\\gems\\cache"})
178
- end
179
- end
180
-
181
- describe "#install_command" do
182
- let(:cmd) { verifier.install_command }
183
-
184
- describe "with no suite test files" do
185
- describe "for bourne shells" do
186
- before { platform.stubs(:shell_type).returns("bourne") }
187
-
188
- it "returns nil" do
189
- cmd.must_be_nil
190
- end
191
- end
192
-
193
- describe "for powershell shells on windows os types" do
194
- before do
195
- platform.stubs(:shell_type).returns("powershell")
196
- platform.stubs(:os_type).returns("windows")
197
- end
198
-
199
- it "returns nil" do
200
- cmd.must_be_nil
201
- end
202
- end
203
- end
204
-
205
- describe "with suite test files" do
206
- describe "common behavior" do
207
- before do
208
- platform.stubs(:shell_type).returns("fake")
209
- create_test_files
210
- end
211
-
212
- it "prefixs the whole command with the command_prefix if set" do
213
- config[:command_prefix] = "my_prefix"
214
-
215
- cmd.must_match(/\Amy_prefix /)
216
- end
217
-
218
- it "does not prefix the command if command_prefix is not set" do
219
- config[:command_prefix] = nil
220
-
221
- cmd.wont_match(/\Amy_prefix /)
222
- end
223
- end
224
-
225
- describe "for bourne shells" do
226
- before do
227
- platform.stubs(:shell_type).returns("bourne")
228
- create_test_files
229
- config[:ruby_bindir] = "/rbd"
230
- config[:root_path] = "/r"
231
- end
232
-
233
- common_bourne_variable_specs
234
-
235
- it "sets path to ruby command" do
236
- cmd.must_match regexify(%{ruby="/rbd/ruby"})
237
- end
238
-
239
- it "sets path to gem command" do
240
- cmd.must_match regexify(%{gem="/rbd/gem"})
241
- end
242
-
243
- it "sets version for busser" do
244
- config[:version] = "the_best"
245
-
246
- cmd.must_match regexify(%{version="the_best"})
247
- end
248
-
249
- it "sets gem install arguments" do
250
- cmd.must_match regexify(
251
- 'gem_install_args="busser --no-rdoc --no-ri --no-format-executable' \
252
- ' -n /r/bin --no-user-install"'
253
- )
254
- end
255
-
256
- it "prepends sudo for busser binstub command when :sudo is set" do
257
- cmd.must_match regexify(%{busser="sudo -E /r/bin/busser"})
258
- end
259
-
260
- it "does not sudo for busser binstub command when :sudo is falsey" do
261
- config[:sudo] = false
262
-
263
- cmd.must_match regexify(%{busser="/r/bin/busser"})
264
- end
265
-
266
- it "sets the busser plugins list" do
267
- cmd.must_match regexify(
268
- %{plugins="busser-abba busser-minispec busser-mondospec"})
269
- end
270
- end
271
-
272
- describe "for powershell shells on windows os types" do
273
- before do
274
- platform.stubs(:shell_type).returns("powershell")
275
- platform.stubs(:os_type).returns("windows")
276
- create_test_files
277
- config[:ruby_bindir] = '\\rbd'
278
- config[:root_path] = '\\r'
279
- end
280
-
281
- common_powershell_variable_specs
282
-
283
- it "sets path to ruby command" do
284
- cmd.must_match regexify(%{$ruby = "\\rbd\\ruby.exe"})
285
- end
286
-
287
- it "sets path to gem command" do
288
- cmd.must_match regexify(%{$gem = "\\rbd\\gem"})
289
- end
290
-
291
- it "sets version for busser" do
292
- config[:version] = "the_best"
293
-
294
- cmd.must_match regexify(%{$version = "the_best"})
295
- end
296
-
297
- it "sets gem install arguments" do
298
- cmd.must_match regexify(
299
- '$gem_install_args = "busser --no-rdoc --no-ri --no-format-executable' \
300
- ' -n \\r\\bin --no-user-install"'
301
- )
302
- end
303
-
304
- it "sets path to busser binstub command" do
305
- cmd.must_match regexify(%{$busser = "\\r\\bin\\busser.bat"})
306
- end
307
-
308
- it "sets the busser plugins list" do
309
- cmd.must_match regexify(
310
- %{$plugins = "busser-abba busser-minispec busser-mondospec"})
311
- end
312
- end
313
- end
314
- end
315
-
316
- describe "#init_command" do
317
- let(:cmd) { verifier.init_command }
318
-
319
- describe "with no suite test files" do
320
- describe "for bourne shells" do
321
- before { platform.stubs(:shell_type).returns("bourne") }
322
-
323
- it "returns nil" do
324
- cmd.must_be_nil
325
- end
326
- end
327
-
328
- describe "for powershell shells on windows os types" do
329
- before do
330
- platform.stubs(:shell_type).returns("powershell")
331
- platform.stubs(:os_type).returns("windows")
332
- end
333
-
334
- it "returns nil" do
335
- cmd.must_be_nil
336
- end
337
- end
338
- end
339
-
340
- describe "with suite test files" do
341
- describe "common behavior" do
342
- before do
343
- platform.stubs(:shell_type).returns("fake")
344
- create_test_files
345
- end
346
-
347
- it "prefixs the whole command with the command_prefix if set" do
348
- config[:command_prefix] = "my_prefix"
349
-
350
- cmd.must_match(/\Amy_prefix /)
351
- end
352
-
353
- it "does not prefix the command if command_prefix is not set" do
354
- config[:command_prefix] = nil
355
-
356
- cmd.wont_match(/\Amy_prefix /)
357
- end
358
- end
359
-
360
- describe "for bourne shells" do
361
- before do
362
- platform.stubs(:shell_type).returns("bourne")
363
- create_test_files
364
- config[:ruby_bindir] = "/rbd"
365
- config[:root_path] = "/r"
366
- end
367
-
368
- common_bourne_variable_specs
369
-
370
- it "runs busser's suite cleanup with sudo, if set" do
371
- config[:root_path] = "/b"
372
- config[:sudo] = true
373
-
374
- cmd.must_match regexify(%{sudo -E /b/bin/busser suite cleanup})
375
- end
376
-
377
- it "runs busser's suite cleanup without sudo, if falsey" do
378
- config[:root_path] = "/b"
379
- config[:sudo] = false
380
-
381
- cmd.wont_match regexify(%{sudo -E /b/bin/busser suite cleanup})
382
- cmd.must_match regexify(%{/b/bin/busser suite cleanup})
383
- end
384
- end
385
-
386
- describe "for powershell shells on windows os types" do
387
- before do
388
- platform.stubs(:shell_type).returns("powershell")
389
- platform.stubs(:os_type).returns("windows")
390
- create_test_files
391
- config[:ruby_bindir] = '\\rbd'
392
- config[:root_path] = '\\r'
393
- end
394
-
395
- common_powershell_variable_specs
396
-
397
- it "runs busser's suite cleanup" do
398
- config[:root_path] = '\\b'
399
-
400
- cmd.must_match regexify(%{& \\b\\bin\\busser.bat suite cleanup})
401
- end
402
- end
403
- end
404
- end
405
-
406
- describe "#run_command" do
407
- let(:cmd) { verifier.run_command }
408
-
409
- describe "with no suite test files" do
410
- describe "for bourne shells" do
411
- before { platform.stubs(:shell_type).returns("bourne") }
412
-
413
- it "returns nil" do
414
- cmd.must_be_nil
415
- end
416
- end
417
-
418
- describe "for powershell shells on windows os types" do
419
- before do
420
- platform.stubs(:shell_type).returns("powershell")
421
- platform.stubs(:os_type).returns("windows")
422
- end
423
-
424
- it "returns nil" do
425
- cmd.must_be_nil
426
- end
427
- end
428
- end
429
-
430
- describe "with suite test files" do
431
- describe "common behavior" do
432
- before do
433
- platform.stubs(:shell_type).returns("fake")
434
- create_test_files
435
- end
436
-
437
- it "prefixs the whole command with the command_prefix if set" do
438
- config[:command_prefix] = "my_prefix"
439
-
440
- cmd.must_match(/\Amy_prefix /)
441
- end
442
-
443
- it "does not prefix the command if command_prefix is not set" do
444
- config[:command_prefix] = nil
445
-
446
- cmd.wont_match(/\Amy_prefix /)
447
- end
448
- end
449
-
450
- describe "for bourne shells" do
451
- before do
452
- platform.stubs(:shell_type).returns("bourne")
453
- create_test_files
454
- config[:ruby_bindir] = "/rbd"
455
- config[:root_path] = "/r"
456
- end
457
-
458
- common_bourne_variable_specs
459
-
460
- it "uses sudo for busser test when configured" do
461
- config[:sudo] = true
462
- config[:busser_bin] = "/p/b"
463
-
464
- cmd.must_match regexify("sudo -E /p/b test", :partial_line)
465
- end
466
-
467
- it "does not use sudo for busser test when configured" do
468
- config[:sudo] = false
469
- config[:busser_bin] = "/p/b"
470
-
471
- cmd.must_match regexify("/p/b test", :partial_line)
472
- cmd.wont_match regexify("sudo -E /p/b test", :partial_line)
473
- end
474
- end
475
-
476
- describe "for powershell shells on windows os types" do
477
- before do
478
- platform.stubs(:shell_type).returns("powershell")
479
- platform.stubs(:os_type).returns("windows")
480
- create_test_files
481
- config[:ruby_bindir] = '\\rbd'
482
- config[:root_path] = '\\r'
483
- end
484
-
485
- common_powershell_variable_specs
486
-
487
- it "runs busser's test" do
488
- config[:root_path] = '\\b'
489
-
490
- cmd.must_match regexify(%{& \\b\\bin\\busser.bat test}, :partial_line)
491
- end
492
- end
493
- end
494
- end
495
-
496
- describe "#create_sandbox" do
497
- before do
498
- create_test_files
499
- end
500
-
501
- it "copies each suite file into the suites directory in sandbox" do
502
- verifier.create_sandbox
503
-
504
- files.each do |f, md|
505
- file = sandbox_path("suites/#{f}")
506
-
507
- file.file?.must_equal true
508
- file.stat.mode.to_s(8)[2, 4].must_equal md[:perms]
509
- IO.read(file).must_equal md[:content]
510
- end
511
- end
512
-
513
- it "copies each helper file into the suites directory in sandbox" do
514
- verifier.create_sandbox
515
-
516
- helper_files.each do |f, md|
517
- file = sandbox_path("suites/#{f}")
518
-
519
- file.file?.must_equal true
520
- file.stat.mode.to_s(8)[2, 4].must_equal md[:perms]
521
- IO.read(file).must_equal md[:content]
522
- end
523
- end
524
-
525
- def sandbox_path(path)
526
- Pathname.new(verifier.sandbox_path).join(path)
527
- end
528
- end
529
-
530
- describe "Busser legacy behavior for code calling old method names" do
531
- let(:busser) { verifier }
532
-
533
- it "responds to #setup_cmd which calls #install_command" do
534
- busser.stubs(:install_command).returns("install")
535
-
536
- busser.setup_cmd.must_equal "install"
537
- end
538
-
539
- it "responds to #run_cmd which calls #run_command" do
540
- busser.stubs(:run_command).returns("run")
541
-
542
- busser.run_cmd.must_equal "run"
543
- end
544
-
545
- it "responds to #sync_cmd which logs a warning" do
546
- busser.sync_cmd
547
-
548
- logged_output.string.must_match warn_line_with(
549
- "Legacy call to #sync_cmd cannot be preserved")
550
- end
551
- end
552
-
553
- def create_file(file, content, perms)
554
- FileUtils.mkdir_p(File.dirname(file))
555
- File.open(file, "wb") { |f| f.write(content) }
556
- FileUtils.chmod(perms.to_i(8), file)
557
- end
558
-
559
- def create_test_files
560
- base = "#{config[:test_base_path]}/germany"
561
- hbase = "#{config[:test_base_path]}/helpers"
562
-
563
- files.map { |f, md| [File.join(base, f), md] }.each do |f, md|
564
- create_file(f, md[:content], md[:perms])
565
- end
566
- helper_files.map { |f, md| [File.join(hbase, f), md] }.each do |f, md|
567
- create_file(f, md[:content], md[:perms])
568
- end
569
- end
570
-
571
- def regexify(str, line = :whole_line)
572
- r = Regexp.escape(str)
573
- r = "^\s*#{r}$" if line == :whole_line
574
- Regexp.new(r)
575
- end
576
-
577
- def warn_line_with(msg)
578
- /^W, .* : #{Regexp.escape(msg)}/
579
- end
580
- end