Loading spec/classes/postfix_spec.rb +431 −428 Original line number Diff line number Diff line Loading @@ -125,9 +125,6 @@ describe 'postfix' do end end context 'when setting parameters' do case facts[:osfamily] when 'Debian' context "when setting smtp_listen to 'all'" do let(:params) do { Loading @@ -148,11 +145,21 @@ describe 'postfix' do end it { is_expected.to contain_package('postfix') } it { is_expected.to contain_package('mailx') } it { is_expected.to contain_exec('newaliases').with_refreshonly('true') } it { is_expected.to contain_postfix__config('myorigin').with_value('localhost') } it { is_expected.to contain_postfix__config('alias_maps').with_value('hash:/etc/aliases') } it { is_expected.to contain_postfix__config('inet_interfaces').with_value('localhost2') } case facts[:os]['family'] when 'FreeBSD' it { is_expected.not_to contain_package('mailx') } else it { is_expected.to contain_package('mailx') } end case facts[:os]['family'] when 'Debian' it { is_expected.to contain_file('/etc/mailname').without('seltype').with_content("foo.example.com\n") } it { is_expected.to contain_file('/etc/aliases').without('seltype').with_content("# file managed by puppet\n") } it { is_expected.to contain_exec('newaliases').with_refreshonly('true') } it { is_expected.to contain_file(postfix_master_cf_path).without('seltype').with_content( Loading @@ -178,12 +185,6 @@ describe 'postfix' do it { is_expected.to contain_file(postfix_main_cf_path).without('seltype') } it { is_expected.to contain_postfix__config('myorigin').with_value('localhost') } it { is_expected.to contain_postfix__config('alias_maps').with_value('hash:/etc/aliases') } it { is_expected.to contain_postfix__config('inet_interfaces').with_value('localhost2') } it { is_expected.to contain_mailalias('root').with_recipient('foo') } it { is_expected.to contain_service('postfix').with( ensure: 'running', Loading @@ -192,8 +193,12 @@ describe 'postfix' do restart: '/etc/init.d/postfix reload' ) } end else it { is_expected.to contain_mailalias('root').with_recipient('foo') } end context 'when specifying inet_interfaces' do let(:params) do { Loading Loading @@ -637,5 +642,3 @@ describe 'postfix' do end end end end end Loading
spec/classes/postfix_spec.rb +431 −428 Original line number Diff line number Diff line Loading @@ -125,9 +125,6 @@ describe 'postfix' do end end context 'when setting parameters' do case facts[:osfamily] when 'Debian' context "when setting smtp_listen to 'all'" do let(:params) do { Loading @@ -148,11 +145,21 @@ describe 'postfix' do end it { is_expected.to contain_package('postfix') } it { is_expected.to contain_package('mailx') } it { is_expected.to contain_exec('newaliases').with_refreshonly('true') } it { is_expected.to contain_postfix__config('myorigin').with_value('localhost') } it { is_expected.to contain_postfix__config('alias_maps').with_value('hash:/etc/aliases') } it { is_expected.to contain_postfix__config('inet_interfaces').with_value('localhost2') } case facts[:os]['family'] when 'FreeBSD' it { is_expected.not_to contain_package('mailx') } else it { is_expected.to contain_package('mailx') } end case facts[:os]['family'] when 'Debian' it { is_expected.to contain_file('/etc/mailname').without('seltype').with_content("foo.example.com\n") } it { is_expected.to contain_file('/etc/aliases').without('seltype').with_content("# file managed by puppet\n") } it { is_expected.to contain_exec('newaliases').with_refreshonly('true') } it { is_expected.to contain_file(postfix_master_cf_path).without('seltype').with_content( Loading @@ -178,12 +185,6 @@ describe 'postfix' do it { is_expected.to contain_file(postfix_main_cf_path).without('seltype') } it { is_expected.to contain_postfix__config('myorigin').with_value('localhost') } it { is_expected.to contain_postfix__config('alias_maps').with_value('hash:/etc/aliases') } it { is_expected.to contain_postfix__config('inet_interfaces').with_value('localhost2') } it { is_expected.to contain_mailalias('root').with_recipient('foo') } it { is_expected.to contain_service('postfix').with( ensure: 'running', Loading @@ -192,8 +193,12 @@ describe 'postfix' do restart: '/etc/init.d/postfix reload' ) } end else it { is_expected.to contain_mailalias('root').with_recipient('foo') } end context 'when specifying inet_interfaces' do let(:params) do { Loading Loading @@ -637,5 +642,3 @@ describe 'postfix' do end end end end end