From 82541496bc291eba0b5880e77ca0f9fed348e1e8 Mon Sep 17 00:00:00 2001 From: Tom Grace Date: Wed, 21 Jan 2015 11:24:02 +0000 Subject: [PATCH] Correct tests to match logic --- spec/classes/nodejs_spec.rb | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/spec/classes/nodejs_spec.rb b/spec/classes/nodejs_spec.rb index 48112a00..4e5970c6 100644 --- a/spec/classes/nodejs_spec.rb +++ b/spec/classes/nodejs_spec.rb @@ -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', @@ -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