mirror of
https://github.com/ardichoke/puppet-arpwatch.git
synced 2026-05-11 02:15:37 -04:00
Convert to pdk module
This commit is contained in:
15
spec/classes/arpwatch_spec.rb
Normal file
15
spec/classes/arpwatch_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'arpwatch' do
|
||||
on_supported_os.each do |os, os_facts|
|
||||
context "on #{os}" do
|
||||
let(:facts) { os_facts }
|
||||
|
||||
it { is_expected.to compile }
|
||||
it { is_expected.to contain_package('arpwatch') }
|
||||
it { is_expected.to contain_service('arpwatch') }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,53 +0,0 @@
|
||||
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
|
||||
Reference in New Issue
Block a user