Merge pull request #609 from hfm/fix-regexp
Fix regexp for $ensure params
This commit is contained in:
commit
efbe46bbc1
2 changed files with 10 additions and 8 deletions
|
@ -49,7 +49,7 @@ define apt::key (
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_re($_id, ['\A(0x)?[0-9a-fA-F]{8}\Z', '\A(0x)?[0-9a-fA-F]{16}\Z', '\A(0x)?[0-9a-fA-F]{40}\Z'])
|
validate_re($_id, ['\A(0x)?[0-9a-fA-F]{8}\Z', '\A(0x)?[0-9a-fA-F]{16}\Z', '\A(0x)?[0-9a-fA-F]{40}\Z'])
|
||||||
validate_re($ensure, ['\Aabsent|present\Z',])
|
validate_re($ensure, ['\A(absent|present)\Z',])
|
||||||
|
|
||||||
if $_content {
|
if $_content {
|
||||||
validate_string($_content)
|
validate_string($_content)
|
||||||
|
|
|
@ -268,13 +268,15 @@ describe 'apt::key' do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'invalid ensure' do
|
context 'invalid ensure' do
|
||||||
let :params do
|
%w(foo aabsent absenta apresent presenta).each do |param|
|
||||||
{
|
let :params do
|
||||||
:ensure => 'foo',
|
{
|
||||||
}
|
:ensure => param,
|
||||||
end
|
}
|
||||||
it 'fails' do
|
end
|
||||||
expect { subject.call }.to raise_error(/does not match/)
|
it 'fails' do
|
||||||
|
expect { subject.call }.to raise_error(/does not match/)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue