From 3c9b9a44d4b00dfdd6a84a916e775a95e11a6221 Mon Sep 17 00:00:00 2001 From: Geekix Date: Thu, 30 Aug 2018 12:20:13 +0200 Subject: [PATCH] Fix ruby syntax according to the PDK validation --- spec/classes/init_spec.rb | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index d64fefa..7ccfa67 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -1,39 +1,37 @@ require 'spec_helper' 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 facts = { - :osfamily => family, - :operatingsystem => system, + osfamily: family, + operatingsystem: system, } let :facts do facts end - it { should contain_class('nslcd') } - it { should contain_class('nslcd::install') } - it { should contain_class('nslcd::config') } - it { should contain_class('nslcd::service') } - + 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 { - should contain_package('nslcd') - should contain_service('nslcd') + is_expected.to contain_package('nslcd') + is_expected.to contain_service('nslcd') } when 'RedHat' it { - should contain_package('nss-pam-ldapd') - should contain_service('nslcd') + is_expected.to contain_package('nss-pam-ldapd') + is_expected.to contain_service('nslcd') } end end end context 'when on an unknown system' do - it { expect { should raise_error(Puppet::Error) } } + it { is_expected.to raise_error(Puppet::Error) } end end