|
363 | 363 |
|
364 | 364 | it 'selects best_version' do |
365 | 365 | expect(provider).to receive(:execute).with( |
366 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', :install, 'myresource-18.3.2'] |
| 366 | + ['/usr/bin/yum', '-y', :install, 'myresource-18.3.2'] |
367 | 367 | ) |
368 | 368 | provider.install |
369 | 369 | end |
|
374 | 374 |
|
375 | 375 | it 'treats no epoch as zero' do |
376 | 376 | expect(provider).to receive(:execute).with( |
377 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', :install, 'myresource-18.3.2'] |
| 377 | + ['/usr/bin/yum', '-y', :install, 'myresource-18.3.2'] |
378 | 378 | ) |
379 | 379 | provider.install |
380 | 380 | end |
|
387 | 387 |
|
388 | 388 | it 'selects best_version and removes epoch' do |
389 | 389 | expect(provider).to receive(:execute).with( |
390 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', :install, 'myresource-18.3.2'] |
| 390 | + ['/usr/bin/yum', '-y', :install, 'myresource-18.3.2'] |
391 | 391 | ) |
392 | 392 | provider.install |
393 | 393 | end |
|
399 | 399 |
|
400 | 400 | it 'uses requested version' do |
401 | 401 | expect(provider).to receive(:execute).with( |
402 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', :install, "myresource->18.1 <19"] |
| 402 | + ['/usr/bin/yum', '-y', :install, "myresource->18.1 <19"] |
403 | 403 | ) |
404 | 404 | provider.install |
405 | 405 | end |
406 | 406 |
|
407 | 407 | it 'logs a debug message' do |
408 | 408 | allow(provider).to receive(:execute).with( |
409 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', :install, "myresource->18.1 <19"] |
| 409 | + ['/usr/bin/yum', '-y', :install, "myresource->18.1 <19"] |
410 | 410 | ) |
411 | 411 |
|
412 | 412 | expect(Puppet).to receive(:debug).with( |
|
422 | 422 |
|
423 | 423 | it 'passes the version to yum command' do |
424 | 424 | expect(provider).to receive(:execute).with( |
425 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', :install, "myresource-1:18.12"] |
| 425 | + ['/usr/bin/yum', '-y', :install, "myresource-1:18.12"] |
426 | 426 | ) |
427 | 427 | provider.install |
428 | 428 | end |
|
440 | 440 |
|
441 | 441 | it 'adds update flag to install command' do |
442 | 442 | expect(provider).to receive(:execute).with( |
443 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', 'update', 'myresource-18.3.2'] |
| 443 | + ['/usr/bin/yum', '-y', 'update', 'myresource-18.3.2'] |
444 | 444 | ) |
445 | 445 | provider.install |
446 | 446 | end |
|
458 | 458 |
|
459 | 459 | it 'adds downgrade flag to install command' do |
460 | 460 | expect(provider).to receive(:execute).with( |
461 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', :downgrade, 'myresource-18.3.2'] |
| 461 | + ['/usr/bin/yum', '-y', :downgrade, 'myresource-18.3.2'] |
462 | 462 | ) |
463 | 463 | provider.install |
464 | 464 | end |
|
470 | 470 | context 'when execute command fails' do |
471 | 471 | before do |
472 | 472 | allow(provider).to receive(:execute).with( |
473 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', :install, "myresource-20"] |
| 473 | + ['/usr/bin/yum', '-y', :install, "myresource-20"] |
474 | 474 | ).and_return('No package myresource-20 available.') |
475 | 475 | end |
476 | 476 |
|
|
484 | 484 | before do |
485 | 485 | allow(provider).to receive(:query) |
486 | 486 | allow(provider).to receive(:execute).with( |
487 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', :install, "myresource-20"] |
| 487 | + ['/usr/bin/yum', '-y', :install, "myresource-20"] |
488 | 488 | ) |
489 | 489 | end |
490 | 490 |
|
|
497 | 497 | context 'when package is not installed' do |
498 | 498 | before do |
499 | 499 | allow(provider).to receive(:execute).with( |
500 | | - ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', :install, "myresource-20"] |
| 500 | + ['/usr/bin/yum', '-y', :install, "myresource-20"] |
501 | 501 | ) |
502 | 502 | allow(provider).to receive(:insync?).and_return(false) |
503 | 503 | end |
|
0 commit comments