Unverified Commit 125d35ca authored by Kenyon Ralph's avatar Kenyon Ralph Committed by GitHub
Browse files

Merge pull request #318 from kenyon/tests-cleanup

remove unneeded tests; provide error message for raise_error
parents e430a8a9 f93a331a
......@@ -13,20 +13,6 @@ describe 'postfix::conffile' do
facts
end
context 'when passing wrong type for ensure' do
let(:params) do
{
ensure: ['present'],
}
end
it 'fails' do
expect do
is_expected.to contain_file('postfix conffile foo')
end.to raise_error
end
end
context 'when passing wrong value for ensure' do
let(:params) do
{
......
......@@ -23,36 +23,7 @@ describe 'postfix::config' do
it 'fails' do
expect do
is_expected.to contain_augeas("set postfix 'foo'")
end.to raise_error
end
end
context 'when passing wrong type for value' do
let(:params) do
{
value: ['bar'],
}
end
it 'fails' do
expect do
is_expected.to contain_augeas("set postfix 'foo'")
end.to raise_error
end
end
context 'when passing wrong type for ensure' do
let(:params) do
{
value: 'bar',
ensure: ['present'],
}
end
it 'fails' do
expect do
is_expected.to contain_augeas("set postfix 'foo'")
end.to raise_error
end.to raise_error(Puppet::Error, %r{can not be empty if ensure = present})
end
end
......
......@@ -13,20 +13,6 @@ describe 'postfix::hash' do
facts
end
context 'when passing wrong type for ensure' do
let(:params) do
{
ensure: ['present'],
}
end
it 'fails' do
expect do
is_expected.to contain_file('/tmp/foo')
end.to raise_error
end
end
context 'when passing wrong value for ensure' do
let(:params) do
{
......
......@@ -20,20 +20,6 @@ describe 'postfix::map' do
facts
end
context 'when passing wrong type for ensure' do
let(:params) do
{
ensure: ['present'],
}
end
it 'fails' do
expect do
is_expected.to contain_file('postfix map foo')
end.to raise_error
end
end
context 'when passing wrong value for ensure' do
let(:params) do
{
......
......@@ -24,50 +24,6 @@ describe 'postfix::transport' do
puppetversion: Puppet.version)
end
context 'when sending wrong type for destination' do
let(:params) do
{
destination: ['bar'],
}
end
it 'fails' do
expect do
is_expected.to contain_augeas('Postfix transport - foo')
end.to raise_error
end
end
context 'when sending wrong type for nexthop' do
let(:params) do
{
destination: 'bar',
nexthop: ['baz'],
}
end
it 'fails' do
expect do
is_expected.to contain_augeas('Postfix transport - foo')
end.to raise_error
end
end
context 'when sending wrong type for file' do
let(:params) do
{
destination: 'bar',
file: ['baz'],
}
end
it 'fails' do
expect do
is_expected.to contain_augeas('Postfix transport - foo')
end.to raise_error
end
end
context 'when sending wrong value for file' do
let(:params) do
{
......@@ -83,21 +39,6 @@ describe 'postfix::transport' do
end
end
context 'when sending wrong type for ensure' do
let(:params) do
{
destination: 'bar',
ensure: ['baz'],
}
end
it 'fails' do
expect do
is_expected.to contain_augeas('Postfix transport - foo')
end.to raise_error
end
end
context 'when sending wrong value for ensure' do
let(:params) do
{
......
......@@ -32,35 +32,6 @@ describe 'postfix::virtual' do
end
end
context 'when sending wrong type for destination' do
let(:params) do
{
destination: true,
}
end
it 'fails' do
expect do
is_expected.to contain_augeas('Postfix virtual - foo')
end.to raise_error
end
end
context 'when sending wrong type for file' do
let(:params) do
{
destination: 'bar',
file: ['baz'],
}
end
it 'fails' do
expect do
is_expected.to contain_augeas('Postfix virtual - foo')
end.to raise_error
end
end
context 'when sending wrong value for file' do
let(:params) do
{
......@@ -76,21 +47,6 @@ describe 'postfix::virtual' do
end
end
context 'when sending wrong type for ensure' do
let(:params) do
{
destination: 'bar',
ensure: ['baz'],
}
end
it 'fails' do
expect do
is_expected.to contain_augeas('Postfix virtual - foo')
end.to raise_error
end
end
context 'when sending wrong value for ensure' do
let(:params) do
{
......
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