From: Helen Date: Mon, 3 Sep 2018 11:47:03 +0000 (+0100) Subject: Merge pull request #789 from david22swan/FM-7316 X-Git-Tag: 6.1.0~12 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c55a6ea90ac351e11b02bd0f9d6ae046e7b971bf;hp=910265a97ea9965d512ac1b508228d9985b22582;p=puppet-modules%2Fpuppetlabs-apt.git Merge pull request #789 from david22swan/FM-7316 (FM-7316) - Implementation of the i18n process --- diff --git a/manifests/key.pp b/manifests/key.pp index 8b77978..4564c6f 100644 --- a/manifests/key.pp +++ b/manifests/key.pp @@ -1,27 +1,12 @@ # == Define: apt::key define apt::key ( - String $id = $title, - Enum['present', 'absent'] $ensure = present, - Optional[String] $content = undef, - Optional[String] $source = undef, - String $server = $::apt::keyserver, - Optional[String] $options = undef, - ) { - - assert_type( - Pattern[ - /\A(0x)?[0-9a-fA-F]{8}\Z/, - /\A(0x)?[0-9a-fA-F]{16}\Z/, - /\A(0x)?[0-9a-fA-F]{40}\Z/, - ], $id) - - if $source { - assert_type(Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/], $source) - } - - if $server { - assert_type(Pattern[/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/], $server) - } + Pattern[/\A(0x)?[0-9a-fA-F]{8}\Z/, /\A(0x)?[0-9a-fA-F]{16}\Z/, /\A(0x)?[0-9a-fA-F]{40}\Z/] $id = $title, + Enum['present', 'absent'] $ensure = present, + Optional[String] $content = undef, + Optional[Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/]] $source = undef, + Pattern[/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/] $server = $::apt::keyserver, + Optional[String] $options = undef, + ) { case $ensure { present: { diff --git a/spec/defines/key_compat_spec.rb b/spec/defines/key_compat_spec.rb index aee5855..ae247d2 100644 --- a/spec/defines/key_compat_spec.rb +++ b/spec/defines/key_compat_spec.rb @@ -271,7 +271,7 @@ describe 'apt::key', type: :define do end it 'fails' do - is_expected.to raise_error(%r{expects a match}) + is_expected.to raise_error(%r{evaluating a Resource}) end end diff --git a/spec/defines/key_spec.rb b/spec/defines/key_spec.rb index d196063..b4ccf16 100644 --- a/spec/defines/key_spec.rb +++ b/spec/defines/key_spec.rb @@ -276,7 +276,7 @@ describe 'apt::key' do end it 'fails' do - is_expected.to raise_error(%r{expects a match}) + is_expected.to raise_error(%r{evaluating a Resource}) end end