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
it {
is_expected.to contain_postfix__virtual('@foo.example.com').with(
ensure: 'present',
destination: 'root',
destination: 'root'
)
}
end
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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') }
......
......@@ -28,9 +28,9 @@ describe 'postfix::map' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_file('postfix map foo')
}.to raise_error
end.to raise_error
end
end
......@@ -42,9 +42,9 @@ describe 'postfix::map' do
end
it 'fails' do
expect {
expect do
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
......@@ -57,9 +57,9 @@ describe 'postfix::map' do
end
it 'fails' do
expect {
expect do
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
......@@ -73,7 +73,7 @@ describe 'postfix::map' do
it {
is_expected.to contain_file('postfix map foo').with(
ensure: 'present',
source: '/tmp/bar',
source: '/tmp/bar'
).without(:content)
}
it { is_expected.to contain_file('postfix map foo.db').with_ensure('present') }
......@@ -90,7 +90,7 @@ describe 'postfix::map' do
it {
is_expected.to contain_file('postfix map foo').with(
ensure: 'present',
content: 'bar',
content: 'bar'
).without(:source)
}
it { is_expected.to contain_file('postfix map foo.db').with_ensure('present') }
......@@ -100,7 +100,7 @@ describe 'postfix::map' do
context 'when not passing source or content' do
it {
is_expected.to contain_file('postfix map foo').with(
ensure: 'present',
ensure: 'present'
).without(:source).without(:content)
}
it { is_expected.to contain_file('postfix map foo.db').with_ensure('present') }
......
......@@ -32,9 +32,9 @@ describe 'postfix::transport' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix transport - foo')
}.to raise_error
end.to raise_error
end
end
......@@ -47,9 +47,9 @@ describe 'postfix::transport' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix transport - foo')
}.to raise_error
end.to raise_error
end
end
......@@ -62,9 +62,9 @@ describe 'postfix::transport' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix transport - foo')
}.to raise_error
end.to raise_error
end
end
......@@ -77,9 +77,9 @@ describe 'postfix::transport' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix transport - foo')
}.to raise_error(Puppet::Error, %r{, got })
end.to raise_error(Puppet::Error, %r{, got })
end
end
......@@ -92,9 +92,9 @@ describe 'postfix::transport' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix transport - foo')
}.to raise_error
end.to raise_error
end
end
......@@ -107,9 +107,9 @@ describe 'postfix::transport' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix transport - foo')
}.to raise_error(Puppet::Error, %r{got 'running'})
end.to raise_error(Puppet::Error, %r{got 'running'})
end
end
......@@ -125,7 +125,7 @@ describe 'postfix::transport' do
"clear pattern[. = 'foo']/nexthop",
"rm pattern[. = 'foo']/host",
"rm pattern[. = 'foo']/port",
],
]
)
}
end
......@@ -151,7 +151,7 @@ describe 'postfix::transport' do
"rm pattern[. = 'foo']/host",
"rm pattern[. = 'foo']/port",
"set pattern[. = 'foo']/nexthop 'baz'",
],
]
)
}
end
......@@ -177,7 +177,7 @@ describe 'postfix::transport' do
"rm pattern[. = 'foo']/nexthop",
"set pattern[. = 'foo']/host '[baz]'",
"set pattern[. = 'foo']/port '1234'",
],
]
)
}
end
......@@ -197,7 +197,7 @@ describe 'postfix::transport' do
lens: 'Postfix_Transport.lns',
changes: [
"rm pattern[. = 'foo']",
],
]
)
}
end
......
......@@ -26,9 +26,9 @@ describe 'postfix::virtual' do
context 'when not sending destination' do
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix virtual - foo')
}.to raise_error(Puppet::Error, %r{destination})
end.to raise_error(Puppet::Error, %r{destination})
end
end
......@@ -40,9 +40,9 @@ describe 'postfix::virtual' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix virtual - foo')
}.to raise_error
end.to raise_error
end
end
......@@ -55,9 +55,9 @@ describe 'postfix::virtual' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix virtual - foo')
}.to raise_error
end.to raise_error
end
end
......@@ -70,9 +70,9 @@ describe 'postfix::virtual' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix virtual - foo')
}.to raise_error(Puppet::Error, %r{, got })
end.to raise_error(Puppet::Error, %r{, got })
end
end
......@@ -85,9 +85,9 @@ describe 'postfix::virtual' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix virtual - foo')
}.to raise_error
end.to raise_error
end
end
......@@ -100,9 +100,9 @@ describe 'postfix::virtual' do
end
it 'fails' do
expect {
expect do
is_expected.to contain_augeas('Postfix virtual - foo')
}.to raise_error(Puppet::Error, %r{got 'running'})
end.to raise_error(Puppet::Error, %r{got 'running'})
end
end
......@@ -122,7 +122,7 @@ describe 'postfix::virtual' do
"defnode entry pattern[. = 'foo'] 'foo'",
'rm $entry/destination',
"set $entry/destination[1] 'bar'",
],
]
)
}
end
......@@ -145,7 +145,7 @@ describe 'postfix::virtual' do
"defnode entry pattern[. = 'foo'] 'foo'",
'rm $entry/destination',
"set $entry/destination[1] 'bar'",
],
]
)
}
end
......@@ -153,7 +153,7 @@ describe 'postfix::virtual' do
context 'when passing destination as array' do
let(:params) do
{
destination: ['bar', 'baz'],
destination: %w[bar baz],
file: '/tmp/virtual',
ensure: 'present',
}
......@@ -169,7 +169,7 @@ describe 'postfix::virtual' do
'rm $entry/destination',
"set $entry/destination[1] 'bar'",
"set $entry/destination[2] 'baz'",
],
]
)
}
end
......@@ -189,7 +189,7 @@ describe 'postfix::virtual' do
lens: 'Postfix_Virtual.lns',
changes: [
"rm pattern[. = 'foo']",
],
]
)
}
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment