Skip to content
Snippets Groups Projects
Commit 6a43e85e authored by Todd Eddy's avatar Todd Eddy
Browse files

Update tests.

parent 100df32a
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,8 @@ define postfix::config ($value = undef, $ensure = 'present') { ...@@ -34,6 +34,8 @@ define postfix::config ($value = undef, $ensure = 'present') {
"\$ensure must be either 'present', 'absent' or 'blank', got '${ensure}'") "\$ensure must be either 'present', 'absent' or 'blank', got '${ensure}'")
if ($ensure == 'present') { if ($ensure == 'present') {
validate_string($value) validate_string($value)
validate_re($value, '^.+$',
'$value can not be empty if ensure = present')
} }
if (!defined(Class['postfix'])) { if (!defined(Class['postfix'])) {
......
...@@ -11,7 +11,7 @@ describe 'postfix::config' do ...@@ -11,7 +11,7 @@ describe 'postfix::config' do
it 'should fail' do it 'should fail' do
expect { expect {
should contain_augeas("set postfix 'foo'") should contain_augeas("set postfix 'foo'")
}.to raise_error(Puppet::Error, /Must pass value to Postfix::Config/) }.to raise_error(Puppet::Error, /value can not be empty/)
end end
end end
...@@ -46,7 +46,7 @@ describe 'postfix::config' do ...@@ -46,7 +46,7 @@ describe 'postfix::config' do
it 'should fail' do it 'should fail' do
expect { expect {
should contain_augeas("set postfix 'foo'") should contain_augeas("set postfix 'foo'")
}.to raise_error(Puppet::Error, /must be either 'present' or 'absent'/) }.to raise_error(Puppet::Error, /must be either 'present', 'absent' or 'blank'/)
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment