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 127c6a1
Show file tree
Hide file tree
Showing 2 changed files with 14 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
8 changes: 8 additions & 0 deletions spec/support/acceptance/purge.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

def purge_node
case fact('osfamily')
when 'Debian'
on default, 'apt-get purge -y libnode*', { acceptable_exit_codes: [0, 100] }
end
end

0 comments on commit 127c6a1

Please sign in to comment.