Merge pull request #789 from david22swan/FM-7316
authorHelen <helen@puppetlabs.com>
Mon, 3 Sep 2018 11:47:03 +0000 (12:47 +0100)
committerGitHub <noreply@github.com>
Mon, 3 Sep 2018 11:47:03 +0000 (12:47 +0100)
(FM-7316) - Implementation of the i18n process

manifests/key.pp
spec/defines/key_compat_spec.rb
spec/defines/key_spec.rb

index 8b77978ffb8d70863f01fcdc8fb9e41a9c5ee775..4564c6fdf19074c456ecff2c8697bd1bd66d2ace 100644 (file)
@@ -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: {
index aee585588c1d2e08cddd4c433db61e43db41a066..ae247d2768b2f3bb0ac561eea21200a8300b3574 100644 (file)
@@ -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
 
index d1960630e89e95cc2242a4d4ce49453226e91ce4..b4ccf1682b51a3310244ef548e2e2a45d91551ba 100644 (file)
@@ -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