Skip to content

Commit

Permalink
add acceptance tests for native Debian packages
Browse files Browse the repository at this point in the history
  • Loading branch information
kenyon committed Nov 16, 2020
1 parent bfb8448 commit 4a0de4d
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,55 @@
end
end
end

# Must uninstall the default nodesource repo and packages which come from there before attempting
# to install native packages.
context 'uninstall' 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,
}
"
end

it_behaves_like 'an idempotent resource'
end

context 'native Debian packages' do
let(:pp) do
"
class { 'nodejs':
manage_package_repo => false,
nodejs_dev_package_ensure => present,
npm_package_ensure => present,
}
"
end

it_behaves_like 'an idempotent resource'

if fact('os.family') == 'Debian'
if %w[9 16.04 18.04].include? fact('os.release.major')
describe package('nodejs-dev') do
it { is_expected.to be_installed }
end
if %w[16.04 18.04].include? fact('os.release.major')
describe package('npm') do
it { is_expected.to be_installed }
end
end
else
describe package('libnode-dev') do
it { is_expected.to be_installed }
end
describe package('npm') do
it { is_expected.to be_installed }
end
end
end
end

0 comments on commit 4a0de4d

Please sign in to comment.