beaker-puppet 1.29.0 → 3.0.0

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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +9 -0
  3. data/.github/workflows/release.yml +3 -3
  4. data/.github/workflows/test.yml +28 -7
  5. data/.github_changelog_generator +3 -0
  6. data/.rubocop.yml +5 -0
  7. data/.rubocop_todo.yml +887 -0
  8. data/CHANGELOG.md +50 -0
  9. data/CODEOWNERS +1 -0
  10. data/Gemfile +5 -20
  11. data/README.md +4 -13
  12. data/Rakefile +64 -169
  13. data/acceptance/config/acceptance-options.rb +3 -3
  14. data/acceptance/config/gem/acceptance-options.rb +8 -8
  15. data/acceptance/config/git/acceptance-options.rb +8 -8
  16. data/acceptance/config/pkg/acceptance-options.rb +7 -7
  17. data/acceptance/pre_suite/gem/install.rb +6 -6
  18. data/acceptance/pre_suite/git/install.rb +22 -22
  19. data/acceptance/pre_suite/pkg/install.rb +3 -3
  20. data/acceptance/tests/backwards_compatible.rb +6 -7
  21. data/acceptance/tests/clone_git_repo_on_test.rb +12 -13
  22. data/acceptance/tests/create_tmpdir_on_test.rb +13 -9
  23. data/acceptance/tests/install_smoke_test.rb +5 -4
  24. data/acceptance/tests/stub_host.rb +11 -10
  25. data/acceptance/tests/web_helpers_test.rb +11 -10
  26. data/beaker-puppet.gemspec +17 -24
  27. data/bin/beaker-puppet +2 -4
  28. data/lib/beaker-puppet/helpers/facter_helpers.rb +9 -7
  29. data/lib/beaker-puppet/helpers/host_helpers.rb +10 -7
  30. data/lib/beaker-puppet/helpers/puppet_helpers.rb +145 -229
  31. data/lib/beaker-puppet/helpers/rake_helpers.rb +1 -1
  32. data/lib/beaker-puppet/helpers/tk_helpers.rb +22 -28
  33. data/lib/beaker-puppet/install_utils/aio_defaults.rb +39 -43
  34. data/lib/beaker-puppet/install_utils/ezbake_utils.rb +34 -42
  35. data/lib/beaker-puppet/install_utils/foss_defaults.rb +134 -138
  36. data/lib/beaker-puppet/install_utils/foss_utils.rb +269 -480
  37. data/lib/beaker-puppet/install_utils/module_utils.rb +58 -70
  38. data/lib/beaker-puppet/install_utils/puppet5.rb +30 -35
  39. data/lib/beaker-puppet/install_utils/puppet_utils.rb +53 -80
  40. data/lib/beaker-puppet/install_utils/windows_utils.rb +34 -36
  41. data/lib/beaker-puppet/version.rb +1 -1
  42. data/lib/beaker-puppet/wrappers.rb +13 -14
  43. data/lib/beaker-puppet.rb +4 -5
  44. data/release-prep.sh +11 -0
  45. data/setup/aio/010_Install_Puppet_Agent.rb +22 -9
  46. data/setup/common/000-delete-puppet-when-none.rb +2 -4
  47. data/setup/common/003_solaris_cert_fix.rb +74 -70
  48. data/setup/common/005_redhat_subscription_fix.rb +3 -2
  49. data/setup/common/011_Install_Puppet_Server.rb +7 -9
  50. data/setup/common/012_Finalize_Installs.rb +5 -5
  51. data/setup/common/025_StopFirewall.rb +1 -1
  52. data/setup/common/030_StopSssd.rb +2 -2
  53. data/setup/common/040_ValidateSignCert.rb +9 -18
  54. data/setup/common/045_EnsureMasterStarted.rb +2 -2
  55. data/setup/gem/010_GemInstall.rb +6 -5
  56. data/setup/git/000_EnvSetup.rb +48 -48
  57. data/setup/git/010_TestSetup.rb +13 -12
  58. data/setup/git/020_PuppetUserAndGroup.rb +3 -2
  59. data/setup/git/060_InstallModules.rb +14 -14
  60. data/setup/git/070_InstallCACerts.rb +82 -82
  61. data/spec/beaker-puppet/helpers/facter_helpers_spec.rb +22 -24
  62. data/spec/beaker-puppet/helpers/host_helpers_spec.rb +10 -6
  63. data/spec/beaker-puppet/helpers/puppet_helpers_spec.rb +463 -724
  64. data/spec/beaker-puppet/helpers/tk_helpers_spec.rb +20 -24
  65. data/spec/beaker-puppet/install_utils/ezbake_utils_spec.rb +86 -90
  66. data/spec/beaker-puppet/install_utils/foss_utils_spec.rb +471 -863
  67. data/spec/beaker-puppet/install_utils/module_utils_spec.rb +125 -116
  68. data/spec/beaker-puppet/install_utils/puppet5_spec.rb +159 -165
  69. data/spec/beaker-puppet/install_utils/puppet_utils_spec.rb +89 -97
  70. data/spec/beaker-puppet/install_utils/windows_utils_spec.rb +101 -89
  71. data/spec/beaker-puppet/wrappers_spec.rb +10 -10
  72. data/spec/helpers.rb +85 -91
  73. data/tasks/ci.rake +188 -188
  74. metadata +38 -62
  75. data/setup/common/020_InstallCumulusModules.rb +0 -13
  76. data/setup/common/021_InstallAristaModuleMasters.rb +0 -12
  77. data/setup/common/022_InstallAristaModuleAgents.rb +0 -13
@@ -11,27 +11,32 @@ class ClassMixedWithDSLInstallUtils
11
11
  end
12
12
 
13
13
  describe ClassMixedWithDSLInstallUtils do
14
- let(:windows_temp) { 'C:\\Windows\\Temp' }
15
- let(:batch_path ) { '/fake/batch/path' }
14
+ let(:windows_temp) { 'C:\\Windows\\Temp' }
15
+ let(:batch_path) { '/fake/batch/path' }
16
16
  let(:msi_path) { 'c:\\foo\\puppet.msi' }
17
- let(:winhost) { make_host( 'winhost',
18
- { :platform => Beaker::Platform.new('windows-2008r2-64'),
19
- :pe_ver => '3.0',
20
- :working_dir => '/tmp',
21
- :is_cygwin => true} ) }
22
- let(:winhost_non_cygwin) { make_host( 'winhost_non_cygwin',
23
- { :platform => 'windows',
24
- :pe_ver => '3.0',
25
- :working_dir => '/tmp',
26
- :is_cygwin => 'false' } ) }
27
- let(:hosts) { [ winhost, winhost_non_cygwin ] }
17
+ let(:winhost) do
18
+ make_host('winhost',
19
+ { platform: Beaker::Platform.new('windows-2008r2-64'),
20
+ pe_ver: '3.0',
21
+ working_dir: '/tmp',
22
+ is_cygwin: true, })
23
+ end
24
+ let(:winhost_non_cygwin) do
25
+ make_host('winhost_non_cygwin',
26
+ { platform: 'windows',
27
+ pe_ver: '3.0',
28
+ working_dir: '/tmp',
29
+ is_cygwin: 'false', })
30
+ end
31
+ let(:hosts) { [winhost, winhost_non_cygwin] }
28
32
 
29
33
  def expect_install_called
30
34
  result = Beaker::Result.new(nil, 'temp')
31
35
  result.exit_code = 0
32
36
 
33
37
  hosts.each do |host|
34
- expectation = expect(subject).to receive(:on).with(host, having_attributes(command: "\"#{batch_path}\""), anything).and_return(result)
38
+ expectation = expect(subject).to receive(:on).with(host, having_attributes(command: "\"#{batch_path}\""),
39
+ anything).and_return(result)
35
40
  if block_given?
36
41
  should_break = yield expectation
37
42
  break if should_break
@@ -44,15 +49,16 @@ describe ClassMixedWithDSLInstallUtils do
44
49
  result.exit_code = 0
45
50
  result.stdout = case start_type
46
51
  when 'DISABLED'
47
- " START_TYPE : 4 DISABLED"
52
+ ' START_TYPE : 4 DISABLED'
48
53
  when 'AUTOMATIC'
49
- " START_TYPE : 2 AUTO_START"
54
+ ' START_TYPE : 2 AUTO_START'
50
55
  else # 'DEMAND_START'
51
- " START_TYPE : 3 DEMAND_START"
56
+ ' START_TYPE : 3 DEMAND_START'
52
57
  end
53
58
 
54
59
  hosts.each do |host|
55
- expect(subject).to receive(:on).with(host, having_attributes(command: "sc qc puppet || sc qc pe-puppet")).and_yield(result)
60
+ expect(subject).to receive(:on).with(host,
61
+ having_attributes(command: 'sc qc puppet || sc qc pe-puppet')).and_yield(result)
56
62
  end
57
63
  end
58
64
 
@@ -69,11 +75,11 @@ describe ClassMixedWithDSLInstallUtils do
69
75
 
70
76
  def expect_script_matches(hosts, contents)
71
77
  hosts.each do |host|
72
- expect( host )
73
- .to receive( :do_scp_to ) do |local_path, remote_path|
78
+ expect(host)
79
+ .to receive(:do_scp_to) do |local_path, remote_path|
74
80
  expect(File.read(local_path)).to match(contents)
75
81
  end
76
- .and_return( true )
82
+ .and_return(true)
77
83
  end
78
84
  end
79
85
 
@@ -84,7 +90,7 @@ describe ClassMixedWithDSLInstallUtils do
84
90
 
85
91
  hosts.each do |host|
86
92
  expect(subject).to receive(:on)
87
- .with(host, having_attributes(command: %r{reg query "HKLM\\SOFTWARE\\Wow6432Node\\Puppet Labs\\PuppetInstaller}))
93
+ .with(host, having_attributes(command: /reg query "HKLM\\SOFTWARE\\Wow6432Node\\Puppet Labs\\PuppetInstaller/))
88
94
  end
89
95
  end
90
96
 
@@ -101,8 +107,8 @@ describe ClassMixedWithDSLInstallUtils do
101
107
  end
102
108
  end
103
109
 
104
- describe "#install_msi_on" do
105
- let( :log_file ) { '/fake/log/file.log' }
110
+ describe '#install_msi_on' do
111
+ let(:log_file) { '/fake/log/file.log' }
106
112
 
107
113
  before :each do
108
114
  result = Beaker::Result.new(nil, 'temp')
@@ -114,83 +120,86 @@ describe ClassMixedWithDSLInstallUtils do
114
120
  .and_return(result)
115
121
  end
116
122
 
117
- allow( subject ).to receive( :file_exists_on ).and_return(true)
118
- allow( subject ).to receive( :create_install_msi_batch_on ).and_return( [batch_path, log_file] )
123
+ allow(subject).to receive(:file_exists_on).and_return(true)
124
+ allow(subject).to receive(:create_install_msi_batch_on).and_return([batch_path, log_file])
119
125
  end
120
126
 
121
- it "will specify a PUPPET_AGENT_STARTUP_MODE of Manual by default" do
127
+ it 'will specify a PUPPET_AGENT_STARTUP_MODE of Manual by default' do
122
128
  expect_install_called
123
129
  expect_puppet_path_called
124
130
  expect_status_called
125
131
  expect_reg_query_called
126
132
  expect_version_log_called
127
- expect( subject ).to receive( :create_install_msi_batch_on ).with(
128
- anything, anything,
129
- {'PUPPET_AGENT_STARTUP_MODE' => 'Manual'})
133
+ expect(subject).to receive(:create_install_msi_batch_on).with(
134
+ anything, anything,
135
+ { 'PUPPET_AGENT_STARTUP_MODE' => 'Manual' }
136
+ )
130
137
  subject.install_msi_on(hosts, msi_path, {})
131
138
  end
132
139
 
133
- it "allows configuration of PUPPET_AGENT_STARTUP_MODE to Automatic" do
140
+ it 'allows configuration of PUPPET_AGENT_STARTUP_MODE to Automatic' do
134
141
  expect_install_called
135
142
  expect_puppet_path_called
136
143
  expect_status_called('AUTOMATIC')
137
144
  expect_reg_query_called
138
145
  expect_version_log_called
139
146
  value = 'Automatic'
140
- expect( subject ).to receive( :create_install_msi_batch_on ).with(
141
- anything, anything,
142
- {'PUPPET_AGENT_STARTUP_MODE' => value})
143
- subject.install_msi_on(hosts, msi_path, {'PUPPET_AGENT_STARTUP_MODE' => value})
147
+ expect(subject).to receive(:create_install_msi_batch_on).with(
148
+ anything, anything,
149
+ { 'PUPPET_AGENT_STARTUP_MODE' => value }
150
+ )
151
+ subject.install_msi_on(hosts, msi_path, { 'PUPPET_AGENT_STARTUP_MODE' => value })
144
152
  end
145
153
 
146
- it "allows configuration of PUPPET_AGENT_STARTUP_MODE to Disabled" do
154
+ it 'allows configuration of PUPPET_AGENT_STARTUP_MODE to Disabled' do
147
155
  expect_install_called
148
156
  expect_puppet_path_called
149
157
  expect_status_called('DISABLED')
150
158
  expect_reg_query_called
151
159
  expect_version_log_called
152
160
  value = 'Disabled'
153
- expect( subject ).to receive( :create_install_msi_batch_on ).with(
161
+ expect(subject).to receive(:create_install_msi_batch_on).with(
154
162
  anything, anything,
155
- {'PUPPET_AGENT_STARTUP_MODE' => value})
156
- subject.install_msi_on(hosts, msi_path, {'PUPPET_AGENT_STARTUP_MODE' => value})
163
+ { 'PUPPET_AGENT_STARTUP_MODE' => value }
164
+ )
165
+ subject.install_msi_on(hosts, msi_path, { 'PUPPET_AGENT_STARTUP_MODE' => value })
157
166
  end
158
167
 
159
- it "will not generate a command to emit a log file without the :debug option set" do
168
+ it 'will not generate a command to emit a log file without the :debug option set' do
160
169
  expect_install_called
161
170
  expect_puppet_path_called
162
171
  expect_status_called
163
172
  expect_reg_query_called
164
173
  expect_version_log_called
165
174
 
166
- expect( subject ).to receive( :file_contents_on ).with(anything, log_file).never
175
+ expect(subject).to receive(:file_contents_on).with(anything, log_file).never
167
176
 
168
177
  subject.install_msi_on(hosts, msi_path)
169
178
  end
170
179
 
171
- it "will generate a command to emit a log file when the install script fails" do
172
- # note a single failure aborts executing against remaining hosts
180
+ it 'will generate a command to emit a log file when the install script fails' do
181
+ # NOTE: a single failure aborts executing against remaining hosts
173
182
  expect_install_called do |e|
174
183
  e.and_raise
175
184
  true # break
176
185
  end
177
186
 
178
- expect( subject ).to receive( :file_contents_on ).with(anything, log_file)
179
- expect {
187
+ expect(subject).to receive(:file_contents_on).with(anything, log_file)
188
+ expect do
180
189
  subject.install_msi_on(hosts, msi_path)
181
- }.to raise_error(RuntimeError)
190
+ end.to raise_error(RuntimeError)
182
191
  end
183
192
 
184
- it "will generate a command to emit a log file with the :debug option set" do
193
+ it 'will generate a command to emit a log file with the :debug option set' do
185
194
  expect_install_called
186
195
  expect_reg_query_called
187
196
  expect_puppet_path_called
188
197
  expect_status_called
189
198
  expect_version_log_called
190
199
 
191
- expect( subject ).to receive( :file_contents_on ).with(anything, log_file).exactly(hosts.length).times
200
+ expect(subject).to receive(:file_contents_on).with(anything, log_file).exactly(hosts.length).times
192
201
 
193
- subject.install_msi_on(hosts, msi_path, {}, { :debug => true })
202
+ subject.install_msi_on(hosts, msi_path, {}, { debug: true })
194
203
  end
195
204
 
196
205
  it 'will pass msi_path to #create_install_msi_batch_on as-is' do
@@ -200,8 +209,9 @@ describe ClassMixedWithDSLInstallUtils do
200
209
  expect_status_called
201
210
  expect_version_log_called
202
211
  test_path = 'test/path'
203
- expect( subject ).to receive( :create_install_msi_batch_on ).with(
204
- anything, test_path, anything)
212
+ expect(subject).to receive(:create_install_msi_batch_on).with(
213
+ anything, test_path, anything
214
+ )
205
215
  subject.install_msi_on(hosts, test_path)
206
216
  end
207
217
 
@@ -215,10 +225,10 @@ describe ClassMixedWithDSLInstallUtils do
215
225
  expect(host).to receive(:is_x86_64?).and_return(true)
216
226
 
217
227
  expect(subject).to receive(:on)
218
- .with(host, having_attributes(command: 'reg query "HKLM\\SOFTWARE\\Wow6432Node\\Puppet Labs\\PuppetInstaller" /v "RememberedPuppetAgentStartupMode" | findstr Manual'))
228
+ .with(host, having_attributes(command: 'reg query "HKLM\\SOFTWARE\\Wow6432Node\\Puppet Labs\\PuppetInstaller" /v "RememberedPuppetAgentStartupMode" | findstr Manual'))
219
229
  end
220
230
 
221
- subject.install_msi_on(hosts, msi_path, {'PUPPET_AGENT_STARTUP_MODE' => "Manual"})
231
+ subject.install_msi_on(hosts, msi_path, { 'PUPPET_AGENT_STARTUP_MODE' => 'Manual' })
222
232
  end
223
233
 
224
234
  it 'will omit Wow6432Node in the registry search for remembered startup setting on 32-bit hosts' do
@@ -234,94 +244,96 @@ describe ClassMixedWithDSLInstallUtils do
234
244
  .with(host, having_attributes(command: 'reg query "HKLM\\SOFTWARE\\Puppet Labs\\PuppetInstaller" /v "RememberedPuppetAgentStartupMode" | findstr Manual'))
235
245
  end
236
246
 
237
- subject.install_msi_on(hosts, msi_path, {'PUPPET_AGENT_STARTUP_MODE' => "Manual"})
247
+ subject.install_msi_on(hosts, msi_path, { 'PUPPET_AGENT_STARTUP_MODE' => 'Manual' })
238
248
  end
239
249
  end
240
250
 
241
251
  describe '#create_install_msi_batch_on' do
242
- let( :tmp ) { '/tmp/create_install_msi_batch_on' }
243
- let( :tmp_slashes ) { tmp.gsub('/', '\\') }
252
+ let(:tmp) { '/tmp/create_install_msi_batch_on' }
253
+ let(:tmp_slashes) { tmp.gsub('/', '\\') }
244
254
 
245
255
  before :each do
246
- FakeFS::FileSystem.add(File.expand_path tmp)
256
+ FakeFS::FileSystem.add(File.expand_path(tmp))
247
257
  hosts.each do |host|
248
- allow( host ).to receive( :system_temp_path ).and_return( tmp )
258
+ allow(host).to receive(:system_temp_path).and_return(tmp)
249
259
  end
250
260
  end
251
261
 
252
262
  it 'passes msi_path & msi_opts down to #msi_install_script' do
253
- allow( winhost ).to receive( :do_scp_to )
263
+ allow(winhost).to receive(:do_scp_to)
254
264
  test_path = '/path/to/test/with/13540'
255
265
  test_opts = { 'key1' => 'val1', 'key2' => 'val2' }
256
- expect( subject ).to receive( :msi_install_script ).with(
257
- test_path, test_opts, anything )
266
+ expect(subject).to receive(:msi_install_script).with(
267
+ test_path, test_opts, anything
268
+ )
258
269
  subject.create_install_msi_batch_on(winhost, test_path, test_opts)
259
270
  end
260
271
 
261
272
  it 'SCPs to & returns the same batch file path, corrected for slashes' do
262
273
  test_time = Time.now
263
- allow( Time ).to receive( :new ).and_return( test_time )
274
+ allow(Time).to receive(:new).and_return(test_time)
264
275
  timestamp = test_time.strftime('%Y-%m-%d_%H.%M.%S')
265
276
 
266
277
  correct_path = "#{tmp_slashes}\\install-puppet-msi-#{timestamp}.bat"
267
- expect( winhost ).to receive( :do_scp_to ).with( anything, correct_path, {} )
268
- test_path, _ = subject.create_install_msi_batch_on( winhost, msi_path, {} )
269
- expect( test_path ).to be === correct_path
278
+ expect(winhost).to receive(:do_scp_to).with(anything, correct_path, {})
279
+ test_path, = subject.create_install_msi_batch_on(winhost, msi_path, {})
280
+ expect(test_path).to be === correct_path
270
281
  end
271
282
 
272
283
  it 'returns & sends log_path to #msi_install_scripts, corrected for slashes' do
273
- allow( winhost ).to receive( :do_scp_to )
284
+ allow(winhost).to receive(:do_scp_to)
274
285
  test_time = Time.now
275
- allow( Time ).to receive( :new ).and_return( test_time )
286
+ allow(Time).to receive(:new).and_return(test_time)
276
287
  timestamp = test_time.strftime('%Y-%m-%d_%H.%M.%S')
277
288
 
278
289
  correct_path = "#{tmp_slashes}\\install-puppet-#{timestamp}.log"
279
- expect( subject ).to receive( :msi_install_script ).with(
280
- anything, anything, correct_path )
281
- _, log_path = subject.create_install_msi_batch_on( winhost, msi_path, {} )
282
- expect( log_path ).to be === correct_path
290
+ expect(subject).to receive(:msi_install_script).with(
291
+ anything, anything, correct_path
292
+ )
293
+ _, log_path = subject.create_install_msi_batch_on(winhost, msi_path, {})
294
+ expect(log_path).to be === correct_path
283
295
  end
284
296
  end
285
297
 
286
298
  describe '#msi_install_script' do
287
- let( :log_path ) { '/log/msi_install_script' }
299
+ let(:log_path) { '/log/msi_install_script' }
288
300
 
289
301
  context 'msi_params parameter' do
290
302
  it 'can take an empty hash' do
291
- expected_cmd = /^start \/w msiexec\.exe \/i ".*" \/qn \/L\*V #{log_path}\ .exit/m
292
- expect( subject.msi_install_script(msi_path, {}, log_path) ).to match(expected_cmd)
303
+ expected_cmd = %r{^start /w msiexec\.exe /i ".*" /qn /L\*V #{log_path}\ .exit}m
304
+ expect(subject.msi_install_script(msi_path, {}, log_path)).to match(expected_cmd)
293
305
  end
294
306
 
295
307
  it 'uses a key-value pair correctly' do
296
308
  params = { 'tk1' => 'tv1' }
297
- expected_cmd = /^start \/w msiexec\.exe \/i ".*" \/qn \/L\*V #{log_path}\ tk1\=tv1/
298
- expect( subject.msi_install_script(msi_path, params, log_path) ).to match(expected_cmd)
309
+ expected_cmd = %r{^start /w msiexec\.exe /i ".*" /qn /L\*V #{log_path}\ tk1=tv1}
310
+ expect(subject.msi_install_script(msi_path, params, log_path)).to match(expected_cmd)
299
311
  end
300
312
 
301
313
  it 'uses multiple key-value pairs correctly' do
302
314
  params = { 'tk1' => 'tv1', 'tk2' => 'tv2' }
303
- expected_cmd = /^start \/w msiexec\.exe \/i ".*" \/qn \/L\*V #{log_path}\ tk1\=tv1\ tk2\=tv2/
304
- expect( subject.msi_install_script(msi_path, params, log_path) ).to match(expected_cmd)
315
+ expected_cmd = %r{^start /w msiexec\.exe /i ".*" /qn /L\*V #{log_path}\ tk1=tv1\ tk2=tv2}
316
+ expect(subject.msi_install_script(msi_path, params, log_path)).to match(expected_cmd)
305
317
  end
306
318
  end
307
319
 
308
320
  context 'msi_path parameter' do
309
- it "will generate an appropriate command with a MSI file path using non-Windows slashes" do
321
+ it 'will generate an appropriate command with a MSI file path using non-Windows slashes' do
310
322
  msi_path = 'c:/foo/puppet.msi'
311
- expected_cmd = /^start \/w msiexec\.exe \/i "c:\\foo\\puppet.msi" \/qn \/L\*V #{log_path}/
312
- expect( subject.msi_install_script(msi_path, {}, log_path) ).to match(expected_cmd)
323
+ expected_cmd = %r{^start /w msiexec\.exe /i "c:\\foo\\puppet.msi" /qn /L\*V #{log_path}}
324
+ expect(subject.msi_install_script(msi_path, {}, log_path)).to match(expected_cmd)
313
325
  end
314
326
 
315
- it "will generate an appropriate command with a MSI http(s) url" do
316
- msi_url = "https://downloads.puppetlabs.com/puppet.msi"
317
- expected_cmd = /^start \/w msiexec\.exe \/i "https\:\/\/downloads\.puppetlabs\.com\/puppet\.msi" \/qn \/L\*V #{log_path}/
318
- expect( subject.msi_install_script(msi_url, {}, log_path) ).to match(expected_cmd)
327
+ it 'will generate an appropriate command with a MSI http(s) url' do
328
+ msi_url = 'https://downloads.puppetlabs.com/puppet.msi'
329
+ expected_cmd = %r{^start /w msiexec\.exe /i "https://downloads\.puppetlabs\.com/puppet\.msi" /qn /L\*V #{log_path}}
330
+ expect(subject.msi_install_script(msi_url, {}, log_path)).to match(expected_cmd)
319
331
  end
320
332
 
321
- it "will generate an appropriate command with a MSI file url" do
322
- msi_url = "file://c:\\foo\\puppet.msi"
323
- expected_cmd = /^start \/w msiexec\.exe \/i "file\:\/\/c:\\foo\\puppet\.msi" \/qn \/L\*V #{log_path}/
324
- expect( subject.msi_install_script(msi_url, {}, log_path) ).to match(expected_cmd)
333
+ it 'will generate an appropriate command with a MSI file url' do
334
+ msi_url = 'file://c:\\foo\\puppet.msi'
335
+ expected_cmd = %r{^start /w msiexec\.exe /i "file://c:\\foo\\puppet\.msi" /qn /L\*V #{log_path}}
336
+ expect(subject.msi_install_script(msi_url, {}, log_path)).to match(expected_cmd)
325
337
  end
326
338
  end
327
339
  end
@@ -5,29 +5,29 @@ class ClassMixedWithDSLWrappers
5
5
  end
6
6
 
7
7
  describe ClassMixedWithDSLWrappers do
8
- let(:empty_opts) { {'ENV' => {}, :cmdexe => true } }
8
+ let(:empty_opts) { { 'ENV' => {}, :cmdexe => true } }
9
9
 
10
10
  describe '#facter' do
11
11
  it 'should split out the options and pass "facter" as first arg to Command' do
12
- expect( Beaker::Command ).to receive( :new ).
13
- with('facter', [ '-p' ], empty_opts)
14
- subject.facter( '-p' )
12
+ expect(Beaker::Command).to receive(:new)
13
+ .with('facter', ['-p'], empty_opts)
14
+ subject.facter('-p')
15
15
  end
16
16
  end
17
17
 
18
18
  describe '#cfacter' do
19
19
  it 'should split out the options and pass "cfacter" as first arg to Command' do
20
- expect( Beaker::Command ).to receive( :new ).
21
- with('cfacter', [ '-p' ], empty_opts)
22
- subject.cfacter( '-p' )
20
+ expect(Beaker::Command).to receive(:new)
21
+ .with('cfacter', ['-p'], empty_opts)
22
+ subject.cfacter('-p')
23
23
  end
24
24
  end
25
25
 
26
26
  describe 'deprecated puppet wrappers' do
27
- %w( resource doc kick cert apply master agent filebucket ).each do |sub|
27
+ %w[resource doc kick cert apply master agent filebucket].each do |sub|
28
28
  it "#{sub} delegates the proper info to #puppet" do
29
- expect( subject ).to receive( :puppet ).with( sub, 'blah' )
30
- subject.send( "puppet_#{sub}", 'blah')
29
+ expect(subject).to receive(:puppet).with(sub, 'blah')
30
+ subject.send("puppet_#{sub}", 'blah')
31
31
  end
32
32
  end
33
33
  end