puppet-nslcd/spec/classes/init_spec.rb

38 lines
1013 B
Ruby
Raw Normal View History

2015-04-16 18:04:30 -04:00
require 'spec_helper'
describe 'nslcd' do
{ 'Ubuntu' => 'Debian', 'Debian' => 'Debian', 'CentOS' => 'RedHat', 'RedHat' => 'RedHat' }.each do |system, family|
2015-04-16 18:04:30 -04:00
context "when on system #{system}" do
facts = {
osfamily: family,
operatingsystem: system,
}
let :facts do
facts
2015-04-16 18:04:30 -04:00
end
it { is_expected.to contain_class('nslcd') }
it { is_expected.to contain_class('nslcd::install') }
it { is_expected.to contain_class('nslcd::config') }
it { is_expected.to contain_class('nslcd::service') }
case facts[:osfamily]
when 'Debian'
it {
is_expected.to contain_package('nslcd')
is_expected.to contain_service('nslcd')
}
when 'RedHat'
it {
is_expected.to contain_package('nss-pam-ldapd')
is_expected.to contain_service('nslcd')
}
end
2015-04-16 18:04:30 -04:00
end
end
context 'when on an unknown system' do
it { is_expected.to raise_error(Puppet::Error) }
2015-04-16 18:04:30 -04:00
end
end