Skip to content

Commit

Permalink
Correct tests to match logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Grace committed Jan 21, 2015
1 parent 67411dd commit 8254149
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions spec/classes/nodejs_spec.rb
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

0 comments on commit 8254149

Please sign in to comment.