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

rubocop auto fix

parent 26a48f0a
...@@ -22,7 +22,7 @@ describe 'postfix::satellite' do ...@@ -22,7 +22,7 @@ describe 'postfix::satellite' do
it { it {
is_expected.to contain_postfix__virtual('@foo.example.com').with( is_expected.to contain_postfix__virtual('@foo.example.com').with(
ensure: 'present', ensure: 'present',
destination: 'root', destination: 'root'
) )
} }
end end
......
...@@ -54,7 +54,7 @@ describe 'postfix' do ...@@ -54,7 +54,7 @@ describe 'postfix' do
ensure: 'running', ensure: 'running',
enable: 'true', enable: 'true',
hasstatus: 'true', hasstatus: 'true',
restart: '/etc/init.d/postfix reload', restart: '/etc/init.d/postfix reload'
) )
} }
end end
...@@ -76,7 +76,7 @@ describe 'postfix' do ...@@ -76,7 +76,7 @@ describe 'postfix' do
ensure: 'running', ensure: 'running',
enable: 'true', enable: 'true',
hasstatus: 'true', hasstatus: 'true',
restart: '/bin/systemctl reload postfix', restart: '/bin/systemctl reload postfix'
) )
} }
end end
...@@ -88,7 +88,7 @@ describe 'postfix' do ...@@ -88,7 +88,7 @@ describe 'postfix' do
ensure: 'running', ensure: 'running',
enable: 'true', enable: 'true',
hasstatus: 'true', hasstatus: 'true',
restart: '/bin/systemctl reload postfix', restart: '/bin/systemctl reload postfix'
) )
} }
end end
...@@ -100,7 +100,7 @@ describe 'postfix' do ...@@ -100,7 +100,7 @@ describe 'postfix' do
ensure: 'running', ensure: 'running',
enable: 'true', enable: 'true',
hasstatus: 'true', hasstatus: 'true',
restart: '/etc/init.d/postfix reload', restart: '/etc/init.d/postfix reload'
) )
} }
...@@ -111,12 +111,12 @@ describe 'postfix' do ...@@ -111,12 +111,12 @@ describe 'postfix' do
ensure: 'running', ensure: 'running',
enable: 'true', enable: 'true',
hasstatus: 'true', hasstatus: 'true',
restart: '/bin/systemctl reload postfix', restart: '/bin/systemctl reload postfix'
) )
} }
end 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 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") } it { is_expected.to contain_file('/etc/aliases').with_seltype('postfix_etc_t').with_content("# file managed by puppet\n") }
end end
...@@ -125,7 +125,7 @@ describe 'postfix' do ...@@ -125,7 +125,7 @@ describe 'postfix' do
ensure: 'running', ensure: 'running',
enable: 'true', enable: 'true',
hasstatus: 'true', hasstatus: 'true',
restart: '/etc/init.d/postfix reload', restart: '/etc/init.d/postfix reload'
) )
} }
end end
...@@ -163,23 +163,23 @@ describe 'postfix' do ...@@ -163,23 +163,23 @@ describe 'postfix' do
it { is_expected.to contain_exec('newaliases').with_refreshonly('true') } it { is_expected.to contain_exec('newaliases').with_refreshonly('true') }
it { it {
is_expected.to contain_file(postfix_master_cf_path).without('seltype').with_content( 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( ).with_content(
%r{amavis unix}, %r{amavis unix}
).with_content( ).with_content(
%r{dovecot.*\n.* user=bar:bar }, %r{dovecot.*\n.* user=bar:bar }
).with_content( ).with_content(
%r{schleuder}, %r{schleuder}
).with_content( ).with_content(
%r{sympa}, %r{sympa}
).with_content( ).with_content(
%r{user=bar}, %r{user=bar}
).with_content( ).with_content(
%r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:}, %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:}
).with_content( ).with_content(
%r{^smtps inet n}, %r{^smtps inet n}
).with_content( ).with_content(
%r{^submission inet n}, %r{^submission inet n}
) )
} }
it { is_expected.to contain_file(postfix_main_cf_path).without('seltype') } it { is_expected.to contain_file(postfix_main_cf_path).without('seltype') }
...@@ -195,7 +195,7 @@ describe 'postfix' do ...@@ -195,7 +195,7 @@ describe 'postfix' do
ensure: 'running', ensure: 'running',
enable: 'true', enable: 'true',
hasstatus: 'true', hasstatus: 'true',
restart: '/etc/init.d/postfix reload', restart: '/etc/init.d/postfix reload'
) )
} }
end end
...@@ -330,9 +330,9 @@ describe 'postfix' do ...@@ -330,9 +330,9 @@ describe 'postfix' do
it 'updates master.cf with the specified flags to smtp' do it 'updates master.cf with the specified flags to smtp' do
is_expected.to contain_file(postfix_master_cf_path).with_content( is_expected.to contain_file(postfix_master_cf_path).with_content(
%r{smtp inet n - - - - smtpd}, %r{smtp inet n - - - - smtpd}
).with_content( ).with_content(
%r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:}, %r{^smtp.*\n.*smtpd_client_restrictions=check_client_access,hash:}
) )
end end
end end
......
...@@ -21,9 +21,9 @@ describe 'postfix::conffile' do ...@@ -21,9 +21,9 @@ describe 'postfix::conffile' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('postfix conffile foo') is_expected.to contain_file('postfix conffile foo')
}.to raise_error end.to raise_error
end end
end end
...@@ -35,9 +35,9 @@ describe 'postfix::conffile' do ...@@ -35,9 +35,9 @@ describe 'postfix::conffile' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('postfix conffile foo') 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
end end
...@@ -50,9 +50,9 @@ describe 'postfix::conffile' do ...@@ -50,9 +50,9 @@ describe 'postfix::conffile' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('postfix conffile foo') 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
end end
...@@ -66,7 +66,7 @@ describe 'postfix::conffile' do ...@@ -66,7 +66,7 @@ describe 'postfix::conffile' do
it { it {
is_expected.to contain_file('postfix conffile foo').with( is_expected.to contain_file('postfix conffile foo').with(
ensure: 'present', ensure: 'present',
source: 'puppet:///modules/postfix/bar', source: 'puppet:///modules/postfix/bar'
).without(:content) ).without(:content)
} }
end end
...@@ -81,16 +81,16 @@ describe 'postfix::conffile' do ...@@ -81,16 +81,16 @@ describe 'postfix::conffile' do
it { it {
is_expected.to contain_file('postfix conffile foo').with( is_expected.to contain_file('postfix conffile foo').with(
ensure: 'present', ensure: 'present',
content: 'bar', content: 'bar'
).without(:source) ).without(:source)
} }
end end
context 'when not passing source or content' do context 'when not passing source or content' do
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('postfix conffile foo') 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
end end
...@@ -138,7 +138,7 @@ describe 'postfix::conffile' do ...@@ -138,7 +138,7 @@ describe 'postfix::conffile' do
it { it {
is_expected.to contain_file('postfix conffile foo').with( is_expected.to contain_file('postfix conffile foo').with(
mode: '0644', mode: '0644',
content: 'bar', content: 'bar'
) )
} }
end end
...@@ -154,7 +154,7 @@ describe 'postfix::conffile' do ...@@ -154,7 +154,7 @@ describe 'postfix::conffile' do
it { it {
is_expected.to contain_file('postfix conffile foo').with( is_expected.to contain_file('postfix conffile foo').with(
path: '/tmp/foo', path: '/tmp/foo',
content: 'bar', content: 'bar'
) )
} }
end end
......
...@@ -21,9 +21,9 @@ describe 'postfix::config' do ...@@ -21,9 +21,9 @@ describe 'postfix::config' do
context 'when not passing value' do context 'when not passing value' do
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_augeas("set postfix 'foo'") is_expected.to contain_augeas("set postfix 'foo'")
}.to raise_error end.to raise_error
end end
end end
...@@ -35,9 +35,9 @@ describe 'postfix::config' do ...@@ -35,9 +35,9 @@ describe 'postfix::config' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_augeas("set postfix 'foo'") is_expected.to contain_augeas("set postfix 'foo'")
}.to raise_error end.to raise_error
end end
end end
...@@ -50,9 +50,9 @@ describe 'postfix::config' do ...@@ -50,9 +50,9 @@ describe 'postfix::config' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_augeas("set postfix 'foo'") is_expected.to contain_augeas("set postfix 'foo'")
}.to raise_error end.to raise_error
end end
end end
...@@ -65,9 +65,9 @@ describe 'postfix::config' do ...@@ -65,9 +65,9 @@ describe 'postfix::config' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_augeas("set postfix 'foo'") 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
end end
...@@ -83,7 +83,7 @@ describe 'postfix::config' do ...@@ -83,7 +83,7 @@ describe 'postfix::config' do
is_expected.to contain_augeas("manage postfix 'foo'").with( is_expected.to contain_augeas("manage postfix 'foo'").with(
incl: postfix_main_cf_path, incl: postfix_main_cf_path,
lens: 'Postfix_Main.lns', lens: 'Postfix_Main.lns',
changes: "set foo 'bar'", changes: "set foo 'bar'"
) )
} }
end end
...@@ -100,7 +100,7 @@ describe 'postfix::config' do ...@@ -100,7 +100,7 @@ describe 'postfix::config' do
is_expected.to contain_augeas("manage postfix 'foo'").with( is_expected.to contain_augeas("manage postfix 'foo'").with(
incl: postfix_main_cf_path, incl: postfix_main_cf_path,
lens: 'Postfix_Main.lns', lens: 'Postfix_Main.lns',
changes: 'rm foo', changes: 'rm foo'
) )
} }
end end
...@@ -117,7 +117,7 @@ describe 'postfix::config' do ...@@ -117,7 +117,7 @@ describe 'postfix::config' do
is_expected.to contain_augeas("manage postfix 'foo'").with( is_expected.to contain_augeas("manage postfix 'foo'").with(
incl: postfix_main_cf_path, incl: postfix_main_cf_path,
lens: 'Postfix_Main.lns', lens: 'Postfix_Main.lns',
changes: 'clear foo', changes: 'clear foo'
) )
} }
end end
......
...@@ -21,9 +21,9 @@ describe 'postfix::hash' do ...@@ -21,9 +21,9 @@ describe 'postfix::hash' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('/tmp/foo') is_expected.to contain_file('/tmp/foo')
}.to raise_error end.to raise_error
end end
end end
...@@ -35,9 +35,9 @@ describe 'postfix::hash' do ...@@ -35,9 +35,9 @@ describe 'postfix::hash' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('/tmp/foo') 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
end end
...@@ -45,9 +45,9 @@ describe 'postfix::hash' do ...@@ -45,9 +45,9 @@ describe 'postfix::hash' do
let(:title) { 'foo' } let(:title) { 'foo' }
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('/tmp/foo') is_expected.to contain_file('/tmp/foo')
}.to raise_error(Puppet::Error, %r{, got }) end.to raise_error(Puppet::Error, %r{, got })
end end
end end
...@@ -60,9 +60,9 @@ describe 'postfix::hash' do ...@@ -60,9 +60,9 @@ describe 'postfix::hash' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('/tmp/foo') 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
end end
...@@ -76,7 +76,7 @@ describe 'postfix::hash' do ...@@ -76,7 +76,7 @@ describe 'postfix::hash' do
it { it {
is_expected.to contain_file('postfix map /tmp/foo').with( is_expected.to contain_file('postfix map /tmp/foo').with(
ensure: 'present', ensure: 'present',
source: '/tmp/bar', source: '/tmp/bar'
).without(:content) ).without(:content)
} }
it { is_expected.to contain_file('postfix map /tmp/foo.db').with_ensure('present') } it { is_expected.to contain_file('postfix map /tmp/foo.db').with_ensure('present') }
...@@ -93,7 +93,7 @@ describe 'postfix::hash' do ...@@ -93,7 +93,7 @@ describe 'postfix::hash' do
it { it {
is_expected.to contain_file('postfix map /tmp/foo').with( is_expected.to contain_file('postfix map /tmp/foo').with(
ensure: 'present', ensure: 'present',
content: 'bar', content: 'bar'
).without(:source) ).without(:source)
} }
it { is_expected.to contain_file('postfix map /tmp/foo.db').with_ensure('present') } it { is_expected.to contain_file('postfix map /tmp/foo.db').with_ensure('present') }
...@@ -103,7 +103,7 @@ describe 'postfix::hash' do ...@@ -103,7 +103,7 @@ describe 'postfix::hash' do
context 'when not passing source or content' do context 'when not passing source or content' do
it { it {
is_expected.to contain_file('postfix map /tmp/foo').with( is_expected.to contain_file('postfix map /tmp/foo').with(
ensure: 'present', ensure: 'present'
).without(:source).without(:content) ).without(:source).without(:content)
} }
it { is_expected.to contain_file('postfix map /tmp/foo.db').with_ensure('present') } it { is_expected.to contain_file('postfix map /tmp/foo.db').with_ensure('present') }
......
...@@ -28,9 +28,9 @@ describe 'postfix::map' do ...@@ -28,9 +28,9 @@ describe 'postfix::map' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('postfix map foo') is_expected.to contain_file('postfix map foo')
}.to raise_error end.to raise_error
end end
end end
...@@ -42,9 +42,9 @@ describe 'postfix::map' do ...@@ -42,9 +42,9 @@ describe 'postfix::map' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('postfix map foo') is_expected.to contain_file('postfix map foo')
}.to raise_error(Puppet::Error, %r{got 'running'}) end.to raise_error(Puppet::Error, %r{got 'running'})
end end
end end
...@@ -57,9 +57,9 @@ describe 'postfix::map' do ...@@ -57,9 +57,9 @@ describe 'postfix::map' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_file('postfix map foo') is_expected.to contain_file('postfix map 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
end end
...@@ -73,7 +73,7 @@ describe 'postfix::map' do ...@@ -73,7 +73,7 @@ describe 'postfix::map' do
it { it {
is_expected.to contain_file('postfix map foo').with( is_expected.to contain_file('postfix map foo').with(
ensure: 'present', ensure: 'present',
source: '/tmp/bar', source: '/tmp/bar'
).without(:content) ).without(:content)
} }
it { is_expected.to contain_file('postfix map foo.db').with_ensure('present') } it { is_expected.to contain_file('postfix map foo.db').with_ensure('present') }
...@@ -90,7 +90,7 @@ describe 'postfix::map' do ...@@ -90,7 +90,7 @@ describe 'postfix::map' do
it { it {
is_expected.to contain_file('postfix map foo').with( is_expected.to contain_file('postfix map foo').with(
ensure: 'present', ensure: 'present',
content: 'bar', content: 'bar'
).without(:source) ).without(:source)
} }
it { is_expected.to contain_file('postfix map foo.db').with_ensure('present') } it { is_expected.to contain_file('postfix map foo.db').with_ensure('present') }
...@@ -100,7 +100,7 @@ describe 'postfix::map' do ...@@ -100,7 +100,7 @@ describe 'postfix::map' do
context 'when not passing source or content' do context 'when not passing source or content' do
it { it {
is_expected.to contain_file('postfix map foo').with( is_expected.to contain_file('postfix map foo').with(
ensure: 'present', ensure: 'present'
).without(:source).without(:content) ).without(:source).without(:content)
} }
it { is_expected.to contain_file('postfix map foo.db').with_ensure('present') } it { is_expected.to contain_file('postfix map foo.db').with_ensure('present') }
......
...@@ -32,9 +32,9 @@ describe 'postfix::transport' do ...@@ -32,9 +32,9 @@ describe 'postfix::transport' do
end end
it 'fails' do it 'fails' do
expect { expect do
is_expected.to contain_augeas('Postfix transport - foo') is_expected.to contain_augeas('Postfix transport - foo')
}.to raise_error end.to raise_error
end end
end end