Fix ruby syntax according to the PDK validation

This commit is contained in:
Geekix 2018-08-30 12:20:13 +02:00
parent 1b1b7050b2
commit 3c9b9a44d4

View File

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