-
-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shared examples: remove 'an idempotent resource'
Use the shared example provided by https://github.com/voxpupuli/voxpupuli-acceptance/blob/730a129a9b5a9fc660f016e74e67dc3be9b4968a/lib/voxpupuli/acceptance/examples.rb instead. This also removes test code for EOL Debian-family.
- Loading branch information
Showing
2 changed files
with
61 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
shared_examples 'an idempotent resource' do | ||
it 'applies with no errors' do | ||
apply_manifest(pp, catch_failures: true) | ||
end | ||
|
||
it 'applies a second time without changes' do | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
end | ||
|
||
shared_examples 'cleanup' do | ||
context 'cleanup' do | ||
let(:pp) do | ||
" | ||
class { 'nodejs': | ||
nodejs_debug_package_ensure => absent, | ||
nodejs_dev_package_ensure => absent, | ||
nodejs_package_ensure => absent, | ||
npm_package_ensure => absent, | ||
repo_ensure => absent, | ||
} | ||
" | ||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
class { 'nodejs': | ||
nodejs_debug_package_ensure => absent, | ||
nodejs_dev_package_ensure => absent, | ||
nodejs_package_ensure => absent, | ||
npm_package_ensure => absent, | ||
repo_ensure => absent, | ||
} | ||
PUPPET | ||
end | ||
end | ||
|
||
it_behaves_like 'an idempotent resource' | ||
|
||
shell('yum info nodejs || true') | ||
shell('yum info nodejs || true') # TODO: remove debugging output | ||
end | ||
end |