|
19 | 19 | } |
20 | 20 |
|
21 | 21 | let(:params) do |
22 | | - { |
23 | | - package_version: package_version |
24 | | - } |
| 22 | + { package_version: package_version } |
25 | 23 | end |
26 | 24 |
|
27 | 25 | describe 'unsupported environment' do |
|
37 | 35 | context 'when FOSS' do |
38 | 36 | describe 'supported environment' do |
39 | 37 | context "when $facts['os']['release']['major'] is supported" do |
40 | | - ['11', '12', '15'].each do |os_version| |
| 38 | + %w[11 12 15].each do |os_version| |
41 | 39 | context "when SLES #{os_version}" do |
42 | 40 | let(:facts) do |
43 | 41 | override_facts(facts, is_pe: false, os: { release: { major: os_version, }, }, platform_tag: "sles-#{os_version}-x86_64") |
44 | 42 | end |
45 | 43 |
|
46 | 44 | let(:params) do |
47 | | - { |
48 | | - package_version: package_version, |
49 | | - } |
| 45 | + { package_version: package_version, } |
50 | 46 | end |
51 | 47 |
|
52 | 48 | script = <<-SCRIPT |
|
94 | 90 | } |
95 | 91 |
|
96 | 92 | context 'with manage_pki_dir => true' do |
97 | | - ['/etc/pki', '/etc/pki/rpm-gpg'].each do |path| |
98 | | - it { |
99 | | - is_expected.to contain_file(path) |
100 | | - .with({ |
101 | | - 'ensure' => 'directory', |
102 | | - }) |
103 | | - } |
| 93 | + %w[/etc/pki /etc/pki/rpm-gpg].each do |path| |
| 94 | + it { is_expected.to contain_file(path).with({ 'ensure' => 'directory', }) } |
104 | 95 | end |
105 | 96 | end |
106 | 97 |
|
107 | 98 | context 'with manage_pki_dir => false' do |
108 | 99 | let(:params) { { manage_pki_dir: false } } |
109 | 100 |
|
110 | | - ['/etc/pki', '/etc/pki/rpm-gpg'].each do |path| |
| 101 | + %w[/etc/pki /etc/pki/rpm-gpg].each do |path| |
111 | 102 | it { is_expected.not_to contain_file(path) } |
112 | 103 | end |
113 | 104 | end |
|
175 | 166 | } |
176 | 167 | end |
177 | 168 |
|
178 | | - [ |
179 | | - 'name', |
180 | | - 'enabled', |
181 | | - 'gpgcheck', |
182 | | - 'autorefresh', |
183 | | - 'baseurl', |
184 | | - 'type', |
185 | | - ].each do |setting| |
| 169 | + %w[name enabled gpgcheck autorefresh baseurl type].each do |setting| |
186 | 170 | it { is_expected.not_to contain_ini_setting("zypper pc_repo #{setting}") } |
187 | 171 | end |
188 | 172 | end |
|
228 | 212 |
|
229 | 213 | describe 'supported environment' do |
230 | 214 | context "when $facts['os']['release']['major'] is supported" do |
231 | | - ['11', '12', '15'].each do |os_version| |
| 215 | + %w[11 12 15].each do |os_version| |
232 | 216 | context "when SLES #{os_version}" do |
233 | 217 | let(:facts) do |
234 | 218 | override_facts(facts, os: { release: { major: os_version, }, }, platform_tag: "sles-#{os_version}-x86_64") |
235 | 219 | end |
236 | 220 |
|
237 | 221 | context 'with manage_pki_dir => true' do |
238 | | - ['/etc/pki', '/etc/pki/rpm-gpg'].each do |path| |
| 222 | + %w[/etc/pki /etc/pki/rpm-gpg].each do |path| |
239 | 223 | it { |
240 | 224 | is_expected.to contain_file(path) |
241 | | - .with({ |
242 | | - 'ensure' => 'directory', |
243 | | - }) |
| 225 | + .with({ 'ensure' => 'directory', }) |
244 | 226 | } |
245 | 227 | end |
246 | 228 | end |
247 | 229 |
|
248 | 230 | context 'with manage_pki_dir => false' do |
249 | 231 | let(:params) { { manage_pki_dir: false } } |
250 | 232 |
|
251 | | - ['/etc/pki', '/etc/pki/rpm-gpg'].each do |path| |
| 233 | + %w[/etc/pki /etc/pki/rpm-gpg].each do |path| |
252 | 234 | it { is_expected.not_to contain_file(path) } |
253 | 235 | end |
254 | 236 | end |
|
314 | 296 | } |
315 | 297 | end |
316 | 298 |
|
317 | | - [ |
318 | | - 'name', |
319 | | - 'enabled', |
320 | | - 'gpgcheck', |
321 | | - 'autorefresh', |
322 | | - 'baseurl', |
323 | | - 'type', |
324 | | - ].each do |setting| |
| 299 | + %w[name enabled gpgcheck autorefresh baseurl type].each do |setting| |
325 | 300 | it { is_expected.not_to contain_ini_setting("zypper pc_repo #{setting}") } |
326 | 301 | end |
327 | 302 | end |
|
360 | 335 | } |
361 | 336 | end |
362 | 337 |
|
363 | | - [ |
364 | | - 'name', |
365 | | - 'enabled', |
366 | | - 'gpgcheck', |
367 | | - 'autorefresh', |
368 | | - 'baseurl', |
369 | | - 'type', |
370 | | - ].each do |setting| |
| 338 | + %w[name enabled gpgcheck autorefresh baseurl type].each do |setting| |
371 | 339 | it { is_expected.not_to contain_ini_setting("zypper pc_repo #{setting}") } |
372 | 340 | end |
373 | 341 | end |
|
0 commit comments