|
95 | 95 |
|
96 | 96 | context 'supports trivial uninstall for a real user' do |
97 | 97 | it do |
98 | | - idempotent_apply(<<~'END') |
| 98 | + idempotent_apply(<<~'PUPPET') |
99 | 99 | rustup { 'user': |
100 | 100 | ensure => absent, |
101 | 101 | } |
102 | | - END |
| 102 | + PUPPET |
103 | 103 | end |
104 | 104 |
|
105 | 105 | describe file('/home/user/.rustup') do |
|
132 | 132 | context 'supports multi-resource install without explicit target' do |
133 | 133 | # Also tests that dist_server works with an explicit undef. |
134 | 134 | it do |
135 | | - idempotent_apply(<<~'END') |
| 135 | + idempotent_apply(<<~'PUPPET') |
136 | 136 | package { 'gcc': } # Needed for cargo install |
137 | 137 | rustup { 'user': |
138 | 138 | dist_server => undef, |
139 | 139 | } |
140 | 140 | rustup::toolchain { 'user: stable': } |
141 | | - END |
| 141 | + PUPPET |
142 | 142 | end |
143 | 143 |
|
144 | 144 | describe file('/home/user/.rustup') do |
|
200 | 200 | # Profiles only work on initial install, so the toolchain must be new. |
201 | 201 | context 'supports multi-resource install with profile and explicit target' do |
202 | 202 | it do |
203 | | - idempotent_apply(<<~'END') |
| 203 | + idempotent_apply(<<~'PUPPET') |
204 | 204 | rustup { 'user': } |
205 | 205 | rustup::toolchain { 'user: beta': |
206 | 206 | profile => minimal, |
207 | 207 | } |
208 | 208 | rustup::target { 'user: default beta': } |
209 | | - END |
| 209 | + PUPPET |
210 | 210 | end |
211 | 211 |
|
212 | 212 | toolchain_name = "beta-#{os[:arch]}-unknown-linux-gnu" |
|
233 | 233 |
|
234 | 234 | context 'supports single-resource pre-release install' do |
235 | 235 | it do |
236 | | - idempotent_apply(<<~'END') |
| 236 | + idempotent_apply(<<~'PUPPET') |
237 | 237 | rustup { 'user': |
238 | 238 | toolchains => ['stable'], |
239 | 239 | targets => ['default'], |
240 | 240 | dist_server => 'https://dev-static.rust-lang.org' |
241 | 241 | } |
242 | | - END |
| 242 | + PUPPET |
243 | 243 | end |
244 | 244 |
|
245 | 245 | toolchain_name = "stable-#{os[:arch]}-unknown-linux-gnu" |
|
262 | 262 |
|
263 | 263 | context 'supports single-resource with multiple toolchains' do |
264 | 264 | it do |
265 | | - idempotent_apply(<<~'END') |
| 265 | + idempotent_apply(<<~'PUPPET') |
266 | 266 | rustup { 'user': |
267 | 267 | toolchains => ['nightly', 'stable'], |
268 | 268 | targets => ['default nightly', 'default stable'], |
269 | 269 | default_toolchain => 'nightly', |
270 | 270 | } |
271 | | - END |
| 271 | + PUPPET |
272 | 272 | end |
273 | 273 |
|
274 | 274 | toolchain_name = "stable-#{os[:arch]}-unknown-linux-gnu" |
|
333 | 333 |
|
334 | 334 | context 'supports multi-resource uninstall for a real user' do |
335 | 335 | it do |
336 | | - idempotent_apply(<<~'END') |
| 336 | + idempotent_apply(<<~'PUPPET') |
337 | 337 | rustup { 'user': |
338 | 338 | ensure => absent, |
339 | 339 | } |
|
343 | 343 | rustup::target { 'user: wasm32-unknown-unknown stable': |
344 | 344 | ensure => absent, |
345 | 345 | } |
346 | | - END |
| 346 | + PUPPET |
347 | 347 | end |
348 | 348 |
|
349 | 349 | describe file('/home/user/.rustup') do |
|
376 | 376 | it 'supports ensure=>absent with non-existant user' do |
377 | 377 | expect(user('non_existant_user')).not_to exist |
378 | 378 |
|
379 | | - idempotent_apply(<<~'END') |
| 379 | + idempotent_apply(<<~'PUPPET') |
380 | 380 | rustup { 'non_existant_user': |
381 | 381 | ensure => absent, |
382 | 382 | } |
|
386 | 386 | rustup::target { 'non_existant_user: wasm32-unknown-unknown stable': |
387 | 387 | ensure => absent, |
388 | 388 | } |
389 | | - END |
| 389 | + PUPPET |
390 | 390 |
|
391 | 391 | expect(user('non_existant_user')).not_to exist |
392 | 392 | end |
393 | 393 |
|
394 | 394 | it 'can remove itself after the user was deleted' do |
395 | 395 | rm_user('rustup_test') |
396 | 396 |
|
397 | | - apply_manifest(<<~'END', catch_failures: true) |
| 397 | + apply_manifest(<<~"PUPPET", catch_failures: true) |
398 | 398 | # Don’t use managehome in case /etc/skel has rustup installed, as is the |
399 | 399 | # case on GitHub CI runners. |
400 | 400 | user { 'rustup_test': |
|
420 | 420 |
|
421 | 421 | rustup { 'rustup_test': } |
422 | 422 | rustup::toolchain { 'rustup_test: stable': } |
423 | | - END |
| 423 | + PUPPET |
424 | 424 |
|
425 | 425 | expect(user('rustup_test')).to exist |
426 | 426 | expect(file('/home/rustup_test/.cargo/bin/rustup')).to exist |
427 | 427 | expect(file('/home/rustup_test/.bashrc').content) |
428 | 428 | .to eq %(# .bashrc\n. "$HOME/.cargo/env"\n) |
429 | 429 |
|
430 | | - apply_manifest(<<~'END', catch_failures: true) |
| 430 | + apply_manifest(<<~'PUPPET', catch_failures: true) |
431 | 431 | user { 'rustup_test': |
432 | 432 | ensure => absent, |
433 | 433 | } |
434 | | - END |
| 434 | + PUPPET |
435 | 435 |
|
436 | 436 | expect(user('rustup_test')).not_to exist |
437 | 437 | expect(file('/home/rustup_test/.cargo/bin/rustup')).to exist |
438 | 438 | expect(file('/home/rustup_test/.bashrc').content) |
439 | 439 | .to eq %(# .bashrc\n. "$HOME/.cargo/env"\n) |
440 | 440 |
|
441 | | - idempotent_apply(<<~'END') |
| 441 | + idempotent_apply(<<~'PUPPET') |
442 | 442 | rustup { 'rustup_test': |
443 | 443 | ensure => absent, |
444 | 444 | } |
445 | 445 |
|
446 | 446 | rustup::toolchain { 'rustup_test: stable': |
447 | 447 | ensure => absent, |
448 | 448 | } |
449 | | - END |
| 449 | + PUPPET |
450 | 450 |
|
451 | 451 | expect(user('rustup_test')).not_to exist |
452 | 452 | expect(file('/home/rustup_test')).to exist |
|
457 | 457 | it 'can remove itself after the user was deleted (with custom cargo_home)' do |
458 | 458 | rm_user('rustup_test') |
459 | 459 |
|
460 | | - apply_manifest(<<~'END', catch_failures: true) |
| 460 | + apply_manifest(<<~"PUPPET", catch_failures: true) |
461 | 461 | # Don’t use managehome in case /etc/skel has rustup installed, as is the |
462 | 462 | # case on GitHub CI runners. |
463 | 463 | user { 'rustup_test': |
|
486 | 486 | } |
487 | 487 |
|
488 | 488 | rustup::toolchain { 'rustup_test: stable': } |
489 | | - END |
| 489 | + PUPPET |
490 | 490 |
|
491 | 491 | expect(user('rustup_test')).to exist |
492 | 492 | expect(file('/home/rustup_test/a/b/.cargo/bin/rustup')).to exist |
493 | 493 | expect(file('/home/rustup_test/.bashrc').content) |
494 | 494 | .to eq %(# .bashrc\n. "/home/rustup_test/a/b/.cargo/env"\n) |
495 | 495 |
|
496 | | - apply_manifest(<<~'END', catch_failures: true) |
| 496 | + apply_manifest(<<~'PUPPET', catch_failures: true) |
497 | 497 | user { 'rustup_test': |
498 | 498 | ensure => absent, |
499 | 499 | } |
500 | | - END |
| 500 | + PUPPET |
501 | 501 |
|
502 | 502 | expect(user('rustup_test')).not_to exist |
503 | 503 | expect(file('/home/rustup_test/a/b/.cargo/bin/rustup')).to exist |
504 | 504 | expect(file('/home/rustup_test/.bashrc').content) |
505 | 505 | .to eq %(# .bashrc\n. "/home/rustup_test/a/b/.cargo/env"\n) |
506 | 506 |
|
507 | | - idempotent_apply(<<~'END') |
| 507 | + idempotent_apply(<<~"PUPPET") |
508 | 508 | rustup { 'rustup_test': |
509 | 509 | ensure => absent, |
510 | 510 | cargo_home => '/home/rustup_test/a/b/.cargo', |
|
513 | 513 | rustup::toolchain { 'rustup_test: stable': |
514 | 514 | ensure => absent, |
515 | 515 | } |
516 | | - END |
| 516 | + PUPPET |
517 | 517 |
|
518 | 518 | expect(user('rustup_test')).not_to exist |
519 | 519 | expect(file('/home/rustup_test')).to exist |
|
0 commit comments