mirror of
https://github.com/ardichoke/puppet-arpwatch.git
synced 2026-05-11 02:15:37 -04:00
Add spec tests, update dependencies
This commit is contained in:
34
spec/classes/init_spec.rb
Normal file
34
spec/classes/init_spec.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
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'})
|
||||
}
|
||||
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'})
|
||||
}
|
||||
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'})
|
||||
}
|
||||
end
|
||||
context 'On an unknown OS' do
|
||||
let :facts do
|
||||
{
|
||||
:osfamily => 'Darwin'
|
||||
}
|
||||
end
|
||||
it {
|
||||
expect { should raise_error(Puppet::Error) }
|
||||
}
|
||||
end
|
||||
end
|
||||
6
spec/spec_helper.rb
Normal file
6
spec/spec_helper.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
require 'rspec-puppet'
|
||||
fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
|
||||
RSpec.configure do |c|
|
||||
c.module_path = File.join(fixture_path, 'modules')
|
||||
c.manifest_dir = File.join(fixture_path, 'manifests')
|
||||
end
|
||||
Reference in New Issue
Block a user