Skip to content

Commit a68d06e

Browse files
authored
Merge pull request #88 from danielparks/acceptance-heredocs
PR Checks / Acceptance: change Puppet code heredoc
2 parents aa289a8 + 82ab893 commit a68d06e

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

spec/acceptance/user_spec.rb

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@
9595

9696
context 'supports trivial uninstall for a real user' do
9797
it do
98-
idempotent_apply(<<~'END')
98+
idempotent_apply(<<~'PUPPET')
9999
rustup { 'user':
100100
ensure => absent,
101101
}
102-
END
102+
PUPPET
103103
end
104104

105105
describe file('/home/user/.rustup') do
@@ -132,13 +132,13 @@
132132
context 'supports multi-resource install without explicit target' do
133133
# Also tests that dist_server works with an explicit undef.
134134
it do
135-
idempotent_apply(<<~'END')
135+
idempotent_apply(<<~'PUPPET')
136136
package { 'gcc': } # Needed for cargo install
137137
rustup { 'user':
138138
dist_server => undef,
139139
}
140140
rustup::toolchain { 'user: stable': }
141-
END
141+
PUPPET
142142
end
143143

144144
describe file('/home/user/.rustup') do
@@ -200,13 +200,13 @@
200200
# Profiles only work on initial install, so the toolchain must be new.
201201
context 'supports multi-resource install with profile and explicit target' do
202202
it do
203-
idempotent_apply(<<~'END')
203+
idempotent_apply(<<~'PUPPET')
204204
rustup { 'user': }
205205
rustup::toolchain { 'user: beta':
206206
profile => minimal,
207207
}
208208
rustup::target { 'user: default beta': }
209-
END
209+
PUPPET
210210
end
211211

212212
toolchain_name = "beta-#{os[:arch]}-unknown-linux-gnu"
@@ -233,13 +233,13 @@
233233

234234
context 'supports single-resource pre-release install' do
235235
it do
236-
idempotent_apply(<<~'END')
236+
idempotent_apply(<<~'PUPPET')
237237
rustup { 'user':
238238
toolchains => ['stable'],
239239
targets => ['default'],
240240
dist_server => 'https://dev-static.rust-lang.org'
241241
}
242-
END
242+
PUPPET
243243
end
244244

245245
toolchain_name = "stable-#{os[:arch]}-unknown-linux-gnu"
@@ -262,13 +262,13 @@
262262

263263
context 'supports single-resource with multiple toolchains' do
264264
it do
265-
idempotent_apply(<<~'END')
265+
idempotent_apply(<<~'PUPPET')
266266
rustup { 'user':
267267
toolchains => ['nightly', 'stable'],
268268
targets => ['default nightly', 'default stable'],
269269
default_toolchain => 'nightly',
270270
}
271-
END
271+
PUPPET
272272
end
273273

274274
toolchain_name = "stable-#{os[:arch]}-unknown-linux-gnu"
@@ -333,7 +333,7 @@
333333

334334
context 'supports multi-resource uninstall for a real user' do
335335
it do
336-
idempotent_apply(<<~'END')
336+
idempotent_apply(<<~'PUPPET')
337337
rustup { 'user':
338338
ensure => absent,
339339
}
@@ -343,7 +343,7 @@
343343
rustup::target { 'user: wasm32-unknown-unknown stable':
344344
ensure => absent,
345345
}
346-
END
346+
PUPPET
347347
end
348348

349349
describe file('/home/user/.rustup') do
@@ -376,7 +376,7 @@
376376
it 'supports ensure=>absent with non-existant user' do
377377
expect(user('non_existant_user')).not_to exist
378378

379-
idempotent_apply(<<~'END')
379+
idempotent_apply(<<~'PUPPET')
380380
rustup { 'non_existant_user':
381381
ensure => absent,
382382
}
@@ -386,15 +386,15 @@
386386
rustup::target { 'non_existant_user: wasm32-unknown-unknown stable':
387387
ensure => absent,
388388
}
389-
END
389+
PUPPET
390390

391391
expect(user('non_existant_user')).not_to exist
392392
end
393393

394394
it 'can remove itself after the user was deleted' do
395395
rm_user('rustup_test')
396396

397-
apply_manifest(<<~'END', catch_failures: true)
397+
apply_manifest(<<~"PUPPET", catch_failures: true)
398398
# Don’t use managehome in case /etc/skel has rustup installed, as is the
399399
# case on GitHub CI runners.
400400
user { 'rustup_test':
@@ -420,33 +420,33 @@
420420
421421
rustup { 'rustup_test': }
422422
rustup::toolchain { 'rustup_test: stable': }
423-
END
423+
PUPPET
424424

425425
expect(user('rustup_test')).to exist
426426
expect(file('/home/rustup_test/.cargo/bin/rustup')).to exist
427427
expect(file('/home/rustup_test/.bashrc').content)
428428
.to eq %(# .bashrc\n. "$HOME/.cargo/env"\n)
429429

430-
apply_manifest(<<~'END', catch_failures: true)
430+
apply_manifest(<<~'PUPPET', catch_failures: true)
431431
user { 'rustup_test':
432432
ensure => absent,
433433
}
434-
END
434+
PUPPET
435435

436436
expect(user('rustup_test')).not_to exist
437437
expect(file('/home/rustup_test/.cargo/bin/rustup')).to exist
438438
expect(file('/home/rustup_test/.bashrc').content)
439439
.to eq %(# .bashrc\n. "$HOME/.cargo/env"\n)
440440

441-
idempotent_apply(<<~'END')
441+
idempotent_apply(<<~'PUPPET')
442442
rustup { 'rustup_test':
443443
ensure => absent,
444444
}
445445
446446
rustup::toolchain { 'rustup_test: stable':
447447
ensure => absent,
448448
}
449-
END
449+
PUPPET
450450

451451
expect(user('rustup_test')).not_to exist
452452
expect(file('/home/rustup_test')).to exist
@@ -457,7 +457,7 @@
457457
it 'can remove itself after the user was deleted (with custom cargo_home)' do
458458
rm_user('rustup_test')
459459

460-
apply_manifest(<<~'END', catch_failures: true)
460+
apply_manifest(<<~"PUPPET", catch_failures: true)
461461
# Don’t use managehome in case /etc/skel has rustup installed, as is the
462462
# case on GitHub CI runners.
463463
user { 'rustup_test':
@@ -486,25 +486,25 @@
486486
}
487487
488488
rustup::toolchain { 'rustup_test: stable': }
489-
END
489+
PUPPET
490490

491491
expect(user('rustup_test')).to exist
492492
expect(file('/home/rustup_test/a/b/.cargo/bin/rustup')).to exist
493493
expect(file('/home/rustup_test/.bashrc').content)
494494
.to eq %(# .bashrc\n. "/home/rustup_test/a/b/.cargo/env"\n)
495495

496-
apply_manifest(<<~'END', catch_failures: true)
496+
apply_manifest(<<~'PUPPET', catch_failures: true)
497497
user { 'rustup_test':
498498
ensure => absent,
499499
}
500-
END
500+
PUPPET
501501

502502
expect(user('rustup_test')).not_to exist
503503
expect(file('/home/rustup_test/a/b/.cargo/bin/rustup')).to exist
504504
expect(file('/home/rustup_test/.bashrc').content)
505505
.to eq %(# .bashrc\n. "/home/rustup_test/a/b/.cargo/env"\n)
506506

507-
idempotent_apply(<<~'END')
507+
idempotent_apply(<<~"PUPPET")
508508
rustup { 'rustup_test':
509509
ensure => absent,
510510
cargo_home => '/home/rustup_test/a/b/.cargo',
@@ -513,7 +513,7 @@
513513
rustup::toolchain { 'rustup_test: stable':
514514
ensure => absent,
515515
}
516-
END
516+
PUPPET
517517

518518
expect(user('rustup_test')).not_to exist
519519
expect(file('/home/rustup_test')).to exist

0 commit comments

Comments
 (0)