Commit ec1d6ab2 authored by Steve Traylen's avatar Steve Traylen
Browse files

RuboCop/Cop/RSpec/EmptyExampleGroup - fixes

Quite a big reorg to case Debian vs non Debian.
parent 7ef0d765
Loading
Loading
Loading
Loading
+431 −428
Original line number Diff line number Diff line
@@ -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
          {
@@ -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(
@@ -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',
@@ -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
          {
@@ -637,5 +642,3 @@ describe 'postfix' do
    end
  end
end
  end
end