Skip to content

Commit

Permalink
try harder to purge old node packages
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Oct 27, 2023
1 parent d9b161b commit cf860d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class { 'nodejs':
end

context 'Debian distribution packages', if: fact('os.family') == 'Debian' do
before(:context) { purge_node }

include_examples 'cleanup'

it_behaves_like 'an idempotent resource' do
Expand All @@ -91,6 +93,8 @@ class { 'nodejs':
end

context 'set global_config_entry secret' do
before(:context) { purge_node }

include_examples 'cleanup'

it_behaves_like 'an idempotent resource' do
Expand All @@ -115,6 +119,8 @@ class { 'nodejs': }
end

context 'set global_config_entry secret unquoted' do
before(:context) { purge_node }

include_examples 'cleanup'

it_behaves_like 'an idempotent resource' do
Expand Down
6 changes: 6 additions & 0 deletions spec/support/acceptance/purge.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def purge_node

Check failure on line 1 in spec/support/acceptance/purge.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Style/FrozenStringLiteralComment: Missing frozen string literal comment.
case fact('osfamily')
when 'Debian'
on default, 'apt-get purge -y libnode*', { :acceptable_exit_codes => [0, 100] }

Check failure on line 4 in spec/support/acceptance/purge.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Style/HashSyntax: Use the new Ruby 1.9 hash syntax. (https://rubystyle.guide#hash-literals)
end
end

0 comments on commit cf860d1

Please sign in to comment.