1
0
mirror of https://github.com/ardichoke/puppet-arpwatch.git synced 2026-05-11 02:15:37 -04:00
Files
puppet-arpwatch/spec/classes/init_spec.rb
2017-04-07 10:41:07 -04:00

54 lines
2.3 KiB
Ruby

require 'spec_helper'
describe 'arpwatch', type: 'class' do
context 'On RedHat 7 with no parameters' do
let (:facts) { { osfamily: 'RedHat', operatingsystemmajrelease: '7' } }
it {
should contain_package('arpwatch').with({'ensure'=>'installed'})
should contain_file('/etc/sysconfig/arpwatch').with({'ensure'=>'file'})
should contain_service('arpwatch').with({'ensure'=>'running', 'enable'=>true})
}
end
context 'On RedHat 6 with no parameters' do
let (:facts) { { osfamily: 'RedHat', operatingsystemmajrelease: '6' } }
it {
should contain_package('arpwatch').with({'ensure'=>'installed'})
should contain_file('/etc/sysconfig/arpwatch').with({'ensure'=>'file'})
should contain_service('arpwatch').with({'ensure'=>'running', 'enable'=>true})
}
end
context 'On RedHat 5 with no parameters' do
let (:facts) { { osfamily: 'RedHat', operatingsystemmajrelease: '6' } }
it {
should contain_package('arpwatch').with({'ensure'=>'installed'})
should contain_file('/etc/sysconfig/arpwatch').with({'ensure'=>'file'})
should contain_service('arpwatch').with({'ensure'=>'running', 'enable'=>true})
}
end
context 'On Debian 6 with no parameters' do
let (:facts) { { osfamily: 'Debian', operatingsystemmajrelease: '6' }}
it {
should contain_package('arpwatch').with({'ensure'=>'installed'})
should contain_file('/etc/default/arpwatch').with({'ensure'=>'file'})
should contain_service('arpwatch').with({'ensure'=>'running', 'enable'=>true})
}
end
context 'On Debian 7 with no parameters' do
let (:facts) { { osfamily: 'Debian', operatingsystemmajrelease: '7' }}
it {
should contain_package('arpwatch').with({'ensure'=>'installed'})
should contain_file('/etc/default/arpwatch').with({'ensure'=>'file'})
should contain_service('arpwatch').with({'ensure'=>'running', 'enable'=>true})
}
end
context 'On an unknown OS' do
let :facts do
{
:osfamily => 'Darwin'
}
end
it {
expect { should raise_error(Puppet::Error) }
}
end
end