-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
test/definitions/procedures/packages/update_all_confirmation_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
require 'test_helper' | ||
require_relative '../../test_helper' | ||
require_relative '../../../../definitions/procedures/packages/update_all_confirmation' | ||
|
||
describe Procedures::Packages::UpdateAllConfirmation do | ||
include ::DefinitionsTestHelper | ||
|
||
def skip_mock_package_manager | ||
true | ||
end | ||
|
||
subject do | ||
Procedures::Packages::UpdateAllConfirmation.new | ||
end | ||
|
||
it 'contains the proper message for Foreman' do | ||
assume_feature_present(:foreman_install) | ||
|
||
question = <<~MSG | ||
WARNING: No specific packages to update were provided | ||
so we are going to update all available packages. We | ||
recommend using the update command to update to a minor | ||
version and/or operating system using 'foreman-maintain update'. | ||
To upgrade to the next Foreman version use 'foreman-maintain upgrade'. | ||
Do you want to proceed with update of everything regardless of | ||
the recommendations? | ||
MSG | ||
|
||
subject.expects(:ask_decision).with(question, :actions_msg => "y(yes), q(quit)").returns(:yes) | ||
|
||
run_procedure(subject) | ||
end | ||
|
||
it 'contains the proper message for Satellite' do | ||
assume_feature_present(:satellite) | ||
|
||
question = <<~MSG | ||
WARNING: No specific packages to update were provided | ||
so we are going to update all available packages. We | ||
recommend using the update command to update to a minor | ||
version and/or operating system using 'satellite-maintain update'. | ||
To upgrade to the next Satellite version use 'satellite-maintain upgrade'. | ||
Do you want to proceed with update of everything regardless of | ||
the recommendations? | ||
MSG | ||
|
||
subject.expects(:ask_decision).with(question, :actions_msg => "y(yes), q(quit)").returns(:yes) | ||
|
||
run_procedure(subject) | ||
end | ||
end |