Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct broken application of PR #70 #106

Merged
merged 2 commits into from
Jan 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@
'Ubuntu': {
# The PPA we are using on Ubuntu includes NPM in the nodejs package, hence
# we must not install it separately
$npm_require = 'Package[nodejs]'
}

'Gentoo': {
# Gentoo installes npm with the nodejs package when configured properly.
# We use the gentoo/portage module since it is expected to be
# available on all gentoo installs.
$npm_require = 'Package[nodejs]'
package_use { $nodejs::params::node_pkg:
ensure => present,
use => 'npm',
Expand All @@ -153,6 +155,7 @@
}

'Archlinux': {
$npm_require = 'Package[nodejs]'
# Archlinux installes npm with the nodejs package.
}

Expand All @@ -162,11 +165,8 @@
name => $npm_pkg,
require => Anchor['nodejs::repo']
}
$npm_require = 'Package[npm]'
}
$npm_require = 'Package[npm]'
} else
{
$npm_require = 'Package[nodejs]'
}

if $proxy {
Expand Down
24 changes: 22 additions & 2 deletions spec/classes/nodejs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,27 @@
end


describe 'when deploying with proxy' do
describe 'when deploying with proxy on CentOS' do
let :facts do
{
:operatingsystem => 'CentOS',
:lsbdistcodename => 'Final',
:lsbdistid => 'CentOS',
}
end

let :params do
{ :proxy => 'http://proxy.puppetlabs.lan:80/' }
end

it { should contain_exec('npm_proxy').with({
'command' => 'npm config set proxy http://proxy.puppetlabs.lan:80/',
'require' => 'Package[npm]',
}) }
it { should_not contain_package('nodejs-stable-release') }
end

describe 'when deploying with proxy on Ubuntu' do
let :facts do
{
:operatingsystem => 'Ubuntu',
Expand All @@ -252,7 +272,7 @@
it { should_not contain_package('npm') }
it { should contain_exec('npm_proxy').with({
'command' => 'npm config set proxy http://proxy.puppetlabs.lan:80/',
'require' => 'Package[npm]',
'require' => 'Package[nodejs]',
}) }
it { should_not contain_package('nodejs-stable-release') }
end
Expand Down