Unverified Commit 1b31cb1f authored by Christos Papageorgiou's avatar Christos Papageorgiou
Browse files

rubocop auto fix

parent 26a48f0a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ describe 'postfix::satellite' do
      it {
        is_expected.to contain_postfix__virtual('@foo.example.com').with(
          ensure: 'present',
          destination: 'root',
          destination: 'root'
        )
      }
    end
+19 −19
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ describe 'postfix' do
              ensure: 'running',
              enable: 'true',
              hasstatus: 'true',
              restart: '/etc/init.d/postfix reload',
              restart: '/etc/init.d/postfix reload'
            )
          }
        end
@@ -76,7 +76,7 @@ describe 'postfix' do
                ensure: 'running',
                enable: 'true',
                hasstatus: 'true',
                restart: '/bin/systemctl reload postfix',
                restart: '/bin/systemctl reload postfix'
              )
            }
          end
@@ -88,7 +88,7 @@ describe 'postfix' do
                ensure: 'running',
                enable: 'true',
                hasstatus: 'true',
                restart: '/bin/systemctl reload postfix',
                restart: '/bin/systemctl reload postfix'
              )
            }
          end
@@ -100,7 +100,7 @@ describe 'postfix' do
                ensure: 'running',
                enable: 'true',
                hasstatus: 'true',
                restart: '/etc/init.d/postfix reload',
                restart: '/etc/init.d/postfix reload'
              )
            }

@@ -111,12 +111,12 @@ describe 'postfix' do
                  ensure: 'running',
                  enable: 'true',
                  hasstatus: 'true',
                  restart: '/bin/systemctl reload postfix',
                  restart: '/bin/systemctl reload postfix'
                )
              }
            end

            context('when on other', excl: (facts[:osfamily] != 'RedHat' || facts[:operatingsystem] == 'Fedora' || ['6', '7', '8'].include?(facts[:operatingsystemmajrelease]))) do
            context('when on other', excl: (facts[:osfamily] != 'RedHat' || facts[:operatingsystem] == 'Fedora' || %w[6 7 8].include?(facts[:operatingsystemmajrelease]))) do
              context('on Linux', excl: facts[:osfamily] != 'Linux') do
                it { is_expected.to contain_file('/etc/aliases').with_seltype('postfix_etc_t').with_content("# file managed by puppet\n") }
              end
@@ -125,7 +125,7 @@ describe 'postfix' do
                  ensure: 'running',
                  enable: 'true',
                  hasstatus: 'true',
                  restart: '/etc/init.d/postfix reload',
                  restart: '/etc/init.d/postfix reload'
                )
              }
            end
@@ -163,23 +163,23 @@ describe 'postfix' do
            it { is_expected.to contain_exec('newaliases').with_refreshonly('true') }
            it {
              is_expected.to contain_file(postfix_master_cf_path).without('seltype').with_content(
                %r{smtp      inet  n       -       -       -       -       smtpd},
                %r{smtp      inet  n       -       -       -       -       smtpd}
              ).with_content(
                %r{amavis unix},
                %r{amavis unix}
              ).with_content(
                %r{dovecot.*\n.* user=bar:bar },
                %r{dovecot.*\n.* user=bar:bar }
              ).with_content(
                %r{schleuder},
                %r{schleuder}
              ).with_content(
                %r{sympa},
                %r{sympa}
              ).with_content(
                %r{user=bar},
                %r{user=bar}
              ).with_content(
                %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:},
                %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:}
              ).with_content(
                %r{^smtps     inet  n},
                %r{^smtps     inet  n}
              ).with_content(
                %r{^submission inet n},
                %r{^submission inet n}
              )
            }
            it { is_expected.to contain_file(postfix_main_cf_path).without('seltype') }
@@ -195,7 +195,7 @@ describe 'postfix' do
                ensure: 'running',
                enable: 'true',
                hasstatus: 'true',
                restart: '/etc/init.d/postfix reload',
                restart: '/etc/init.d/postfix reload'
              )
            }
          end
@@ -330,9 +330,9 @@ describe 'postfix' do

            it 'updates master.cf with the specified flags to smtp' do
              is_expected.to contain_file(postfix_master_cf_path).with_content(
                %r{smtp      inet  n       -       -       -       -       smtpd},
                %r{smtp      inet  n       -       -       -       -       smtpd}
              ).with_content(
                %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:},
                %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:}
              )
            end
          end
+12 −12
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@ describe 'postfix::conffile' do
        end

        it 'fails' do
          expect {
          expect do
            is_expected.to contain_file('postfix conffile foo')
          }.to raise_error
          end.to raise_error
        end
      end

@@ -35,9 +35,9 @@ describe 'postfix::conffile' do
        end

        it 'fails' do
          expect {
          expect do
            is_expected.to contain_file('postfix conffile foo')
          }.to raise_error(Puppet::Error, %r{got 'running'})
          end.to raise_error(Puppet::Error, %r{got 'running'})
        end
      end

@@ -50,9 +50,9 @@ describe 'postfix::conffile' do
        end

        it 'fails' do
          expect {
          expect do
            is_expected.to contain_file('postfix conffile foo')
          }.to raise_error(Puppet::Error, %r{You must provide either 'source' or 'content'})
          end.to raise_error(Puppet::Error, %r{You must provide either 'source' or 'content'})
        end
      end

@@ -66,7 +66,7 @@ describe 'postfix::conffile' do
        it {
          is_expected.to contain_file('postfix conffile foo').with(
            ensure: 'present',
            source: 'puppet:///modules/postfix/bar',
            source: 'puppet:///modules/postfix/bar'
          ).without(:content)
        }
      end
@@ -81,16 +81,16 @@ describe 'postfix::conffile' do
        it {
          is_expected.to contain_file('postfix conffile foo').with(
            ensure: 'present',
            content: 'bar',
            content: 'bar'
          ).without(:source)
        }
      end

      context 'when not passing source or content' do
        it 'fails' do
          expect {
          expect do
            is_expected.to contain_file('postfix conffile foo')
          }.to raise_error(Puppet::Error, %r{You must provide 'options' hash parameter if you don't provide 'source' neither 'content'})
          end.to raise_error(Puppet::Error, %r{You must provide 'options' hash parameter if you don't provide 'source' neither 'content'})
        end
      end

@@ -138,7 +138,7 @@ describe 'postfix::conffile' do
        it {
          is_expected.to contain_file('postfix conffile foo').with(
            mode: '0644',
            content: 'bar',
            content: 'bar'
          )
        }
      end
@@ -154,7 +154,7 @@ describe 'postfix::conffile' do
        it {
          is_expected.to contain_file('postfix conffile foo').with(
            path: '/tmp/foo',
            content: 'bar',
            content: 'bar'
          )
        }
      end
+11 −11
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@ describe 'postfix::config' do

      context 'when not passing value' do
        it 'fails' do
          expect {
          expect do
            is_expected.to contain_augeas("set postfix 'foo'")
          }.to raise_error
          end.to raise_error
        end
      end

@@ -35,9 +35,9 @@ describe 'postfix::config' do
        end

        it 'fails' do
          expect {
          expect do
            is_expected.to contain_augeas("set postfix 'foo'")
          }.to raise_error
          end.to raise_error
        end
      end

@@ -50,9 +50,9 @@ describe 'postfix::config' do
        end

        it 'fails' do
          expect {
          expect do
            is_expected.to contain_augeas("set postfix 'foo'")
          }.to raise_error
          end.to raise_error
        end
      end

@@ -65,9 +65,9 @@ describe 'postfix::config' do
        end

        it 'fails' do
          expect {
          expect do
            is_expected.to contain_augeas("set postfix 'foo'")
          }.to raise_error(Puppet::Error, %r{got 'running'})
          end.to raise_error(Puppet::Error, %r{got 'running'})
        end
      end

@@ -83,7 +83,7 @@ describe 'postfix::config' do
          is_expected.to contain_augeas("manage postfix 'foo'").with(
            incl: postfix_main_cf_path,
            lens: 'Postfix_Main.lns',
            changes: "set foo 'bar'",
            changes: "set foo 'bar'"
          )
        }
      end
@@ -100,7 +100,7 @@ describe 'postfix::config' do
          is_expected.to contain_augeas("manage postfix 'foo'").with(
            incl: postfix_main_cf_path,
            lens: 'Postfix_Main.lns',
            changes: 'rm foo',
            changes: 'rm foo'
          )
        }
      end
@@ -117,7 +117,7 @@ describe 'postfix::config' do
          is_expected.to contain_augeas("manage postfix 'foo'").with(
            incl: postfix_main_cf_path,
            lens: 'Postfix_Main.lns',
            changes: 'clear foo',
            changes: 'clear foo'
          )
        }
      end
+11 −11
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@ describe 'postfix::hash' do
        end

        it 'fails' do
          expect {
          expect do
            is_expected.to contain_file('/tmp/foo')
          }.to raise_error
          end.to raise_error
        end
      end

@@ -35,9 +35,9 @@ describe 'postfix::hash' do
        end

        it 'fails' do
          expect {
          expect do
            is_expected.to contain_file('/tmp/foo')
          }.to raise_error(Puppet::Error, %r{got 'running'})
          end.to raise_error(Puppet::Error, %r{got 'running'})
        end
      end

@@ -45,9 +45,9 @@ describe 'postfix::hash' do
        let(:title) { 'foo' }

        it 'fails' do
          expect {
          expect do
            is_expected.to contain_file('/tmp/foo')
          }.to raise_error(Puppet::Error, %r{, got })
          end.to raise_error(Puppet::Error, %r{, got })
        end
      end

@@ -60,9 +60,9 @@ describe 'postfix::hash' do
        end

        it 'fails' do
          expect {
          expect do
            is_expected.to contain_file('/tmp/foo')
          }.to raise_error(Puppet::Error, %r{You must provide either 'source' or 'content'})
          end.to raise_error(Puppet::Error, %r{You must provide either 'source' or 'content'})
        end
      end

@@ -76,7 +76,7 @@ describe 'postfix::hash' do
        it {
          is_expected.to contain_file('postfix map /tmp/foo').with(
            ensure: 'present',
            source: '/tmp/bar',
            source: '/tmp/bar'
          ).without(:content)
        }
        it { is_expected.to contain_file('postfix map /tmp/foo.db').with_ensure('present') }
@@ -93,7 +93,7 @@ describe 'postfix::hash' do
        it {
          is_expected.to contain_file('postfix map /tmp/foo').with(
            ensure: 'present',
            content: 'bar',
            content: 'bar'
          ).without(:source)
        }
        it { is_expected.to contain_file('postfix map /tmp/foo.db').with_ensure('present') }
@@ -103,7 +103,7 @@ describe 'postfix::hash' do
      context 'when not passing source or content' do
        it {
          is_expected.to contain_file('postfix map /tmp/foo').with(
            ensure: 'present',
            ensure: 'present'
          ).without(:source).without(:content)
        }
        it { is_expected.to contain_file('postfix map /tmp/foo.db').with_ensure('present') }
Loading