Loading manifests/config.pp +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ define postfix::config ($value = undef, $ensure = 'present') { "\$ensure must be either 'present', 'absent' or 'blank', got '${ensure}'") if ($ensure == 'present') { validate_string($value) validate_re($value, '^.+$', '$value can not be empty if ensure = present') } if (!defined(Class['postfix'])) { Loading spec/defines/postfix_config_spec.rb +2 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ describe 'postfix::config' do it 'should fail' do expect { 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 Loading Loading @@ -46,7 +46,7 @@ describe 'postfix::config' do it 'should fail' do expect { 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 Loading Loading
manifests/config.pp +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ define postfix::config ($value = undef, $ensure = 'present') { "\$ensure must be either 'present', 'absent' or 'blank', got '${ensure}'") if ($ensure == 'present') { validate_string($value) validate_re($value, '^.+$', '$value can not be empty if ensure = present') } if (!defined(Class['postfix'])) { Loading
spec/defines/postfix_config_spec.rb +2 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ describe 'postfix::config' do it 'should fail' do expect { 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 Loading Loading @@ -46,7 +46,7 @@ describe 'postfix::config' do it 'should fail' do expect { 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 Loading