Skip to content

Commit

Permalink
Fix spec tests and update to use stdlib 3.2.x branch for spec accepta…
Browse files Browse the repository at this point in the history
…nce testing
  • Loading branch information
Travis Fields committed Oct 31, 2014
1 parent 8491dd6 commit be63c07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 9 additions & 5 deletions spec/classes/ntp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
let :facts do
super().merge({ :osfamily => 'Linux', :operatingsystem => 'Gentoo' })
end
elsif system == 'Suse'
let :facts do
super().merge({ :osfamily => system,:operatingsystem => 'SLES',:operatingsystemmajrelease => '11' })
end
else
let :facts do
super().merge({ :osfamily => system })
Expand Down Expand Up @@ -214,19 +218,19 @@
:servers => ['a', 'b', 'c', 'd'],
:logfile => '/var/log/foobar.log',
}}

it 'should contain logfile setting' do
should contain_file('/etc/ntp.conf').with({
'content' => /^logfile = \/var\/log\/foobar\.log\n/,
})
end
end

context 'when set to false' do
let(:params) {{
:servers => ['a', 'b', 'c', 'd'],
}}

it 'should not contain a logfile line' do
should_not contain_file('/etc/ntp.conf').with({
'content' => /logfile =/,
Expand Down Expand Up @@ -289,13 +293,13 @@

describe "on osfamily Suse" do
let :facts do
super().merge({ :osfamily => 'Suse' })
super().merge({ :osfamily => 'Suse', :operatingsystem => 'SLES',:operatingsystemmajrelease => '11' })
end

it 'uses the opensuse ntp servers by default' do
should contain_file('/etc/ntp.conf').with({
'content' => /server \d.opensuse.pool.ntp.org/,
})
})
end
end

Expand Down
3 changes: 1 addition & 2 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
end
on host, "mkdir -p #{host['distmoduledir']}"
on host, apply_manifest('package{"git":ensure => present}')
on host, 'git clone https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib'
#on host, puppet('module install puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]}
on host, 'git clone -b 3.2.x https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib'
end
end

Expand Down

0 comments on commit be63c07

Please sign in to comment.