diff --git a/.rubocop.yml b/.rubocop.yml index d973ebde8..ec486001b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -25,6 +25,8 @@ RSpec/BeforeAfterAll: RSpec/HookArgument: Description: Prefer explicit :each argument, matching existing module's style EnforcedStyle: each +Style/HashSyntax: + EnforcedStyle: hash_rockets Style/BlockDelimiters: Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then. @@ -97,4 +99,4 @@ Style/IfUnlessModifier: Style/SymbolProc: Enabled: false RSpec/NamedSubject: - Enabled: false \ No newline at end of file + Enabled: false diff --git a/lib/facter/facter_dot_d.rb b/lib/facter/facter_dot_d.rb index f1ef9bcc8..8f72e2e84 100644 --- a/lib/facter/facter_dot_d.rb +++ b/lib/facter/facter_dot_d.rb @@ -119,7 +119,7 @@ def cache_save! def cache_store(file, data) load_cache - @cache[file] = { data: data, stored: Time.now.to_i } + @cache[file] = { :data => data, :stored => Time.now.to_i } rescue # rubocop:disable Lint/HandleExceptions - Is meant to be suppressed end diff --git a/lib/facter/package_provider.rb b/lib/facter/package_provider.rb index ae05d8185..0aec17183 100644 --- a/lib/facter/package_provider.rb +++ b/lib/facter/package_provider.rb @@ -13,9 +13,9 @@ Facter.add(:package_provider) do setcode do if defined? Gem && Gem::Version.new(Facter.value(:puppetversion).split(' ')[0]) >= Gem::Version.new('3.6') - Puppet::Type.type(:package).newpackage(name: 'dummy', allow_virtual: 'true')[:provider].to_s + Puppet::Type.type(:package).newpackage(:name => 'dummy', :allow_virtual => 'true')[:provider].to_s else - Puppet::Type.type(:package).newpackage(name: 'dummy')[:provider].to_s + Puppet::Type.type(:package).newpackage(:name => 'dummy')[:provider].to_s end end end diff --git a/lib/facter/pe_version.rb b/lib/facter/pe_version.rb index 6ce7eac15..594f9dce6 100644 --- a/lib/facter/pe_version.rb +++ b/lib/facter/pe_version.rb @@ -31,7 +31,7 @@ end Facter.add('pe_major_version') do - confine is_pe: true + confine :is_pe => true setcode do pe_version = Facter.value(:pe_version) if pe_version @@ -41,7 +41,7 @@ end Facter.add('pe_minor_version') do - confine is_pe: true + confine :is_pe => true setcode do pe_version = Facter.value(:pe_version) if pe_version @@ -51,7 +51,7 @@ end Facter.add('pe_patch_version') do - confine is_pe: true + confine :is_pe => true setcode do pe_version = Facter.value(:pe_version) if pe_version diff --git a/lib/facter/root_home.rb b/lib/facter/root_home.rb index 35d6410af..d4add7b4d 100644 --- a/lib/facter/root_home.rb +++ b/lib/facter/root_home.rb @@ -18,7 +18,7 @@ def returnt_root_home end Facter.add(:root_home) do - confine kernel: :darwin + confine :kernel => :darwin setcode do str = Facter::Util::Resolution.exec('dscacheutil -q user -a name root') hash = {} @@ -31,7 +31,7 @@ def returnt_root_home end Facter.add(:root_home) do - confine kernel: :aix + confine :kernel => :aix root_home = nil setcode do str = Facter::Util::Resolution.exec('lsuser -c -a home root') diff --git a/lib/facter/service_provider.rb b/lib/facter/service_provider.rb index 22167716b..a11792115 100644 --- a/lib/facter/service_provider.rb +++ b/lib/facter/service_provider.rb @@ -12,6 +12,6 @@ Facter.add(:service_provider) do setcode do - Puppet::Type.type(:service).newservice(name: 'dummy')[:provider].to_s + Puppet::Type.type(:service).newservice(:name => 'dummy')[:provider].to_s end end diff --git a/lib/puppet/parser/functions/abs.rb b/lib/puppet/parser/functions/abs.rb index 1b6d2baac..078d35f48 100644 --- a/lib/puppet/parser/functions/abs.rb +++ b/lib/puppet/parser/functions/abs.rb @@ -2,7 +2,7 @@ # abs.rb # module Puppet::Parser::Functions - newfunction(:abs, type: :rvalue, doc: <<-EOS + newfunction(:abs, :type => :rvalue, :doc => <<-EOS Returns the absolute value of a number, for example -34.56 becomes 34.56. Takes a single integer and float value as an argument. EOS diff --git a/lib/puppet/parser/functions/any2array.rb b/lib/puppet/parser/functions/any2array.rb index 4c47a4e68..0a701db3f 100644 --- a/lib/puppet/parser/functions/any2array.rb +++ b/lib/puppet/parser/functions/any2array.rb @@ -2,7 +2,7 @@ # any2array.rb # module Puppet::Parser::Functions - newfunction(:any2array, type: :rvalue, doc: <<-EOS + newfunction(:any2array, :type => :rvalue, :doc => <<-EOS This converts any object to an array containing that object. Empty argument lists are converted to an empty array. Arrays are left untouched. Hashes are converted to arrays of alternating keys and values. diff --git a/lib/puppet/parser/functions/any2bool.rb b/lib/puppet/parser/functions/any2bool.rb index 0d86477da..809b9569f 100644 --- a/lib/puppet/parser/functions/any2bool.rb +++ b/lib/puppet/parser/functions/any2bool.rb @@ -2,7 +2,7 @@ # any2bool.rb # module Puppet::Parser::Functions - newfunction(:any2bool, type: :rvalue, doc: <<-EOS + newfunction(:any2bool, :type => :rvalue, :doc => <<-EOS This converts 'anything' to a boolean. In practise it does the following: * Strings such as Y,y,1,T,t,TRUE,yes,'true' will return true diff --git a/lib/puppet/parser/functions/assert_private.rb b/lib/puppet/parser/functions/assert_private.rb index a61686024..9e659f900 100644 --- a/lib/puppet/parser/functions/assert_private.rb +++ b/lib/puppet/parser/functions/assert_private.rb @@ -2,7 +2,7 @@ # assert_private.rb # module Puppet::Parser::Functions - newfunction(:assert_private, doc: <<-'EOS' + newfunction(:assert_private, :doc => <<-'EOS' Sets the current class or definition as private. Calling the class or definition from outside the current module will fail. EOS diff --git a/lib/puppet/parser/functions/base64.rb b/lib/puppet/parser/functions/base64.rb index 9847cd920..9c35563e6 100644 --- a/lib/puppet/parser/functions/base64.rb +++ b/lib/puppet/parser/functions/base64.rb @@ -1,6 +1,6 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. module Puppet::Parser::Functions - newfunction(:base64, type: :rvalue, doc: <<-'ENDHEREDOC') do |args| + newfunction(:base64, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| Base64 encode or decode a string based on the command and the string submitted Usage: diff --git a/lib/puppet/parser/functions/basename.rb b/lib/puppet/parser/functions/basename.rb index a134f7f55..cc65efe92 100644 --- a/lib/puppet/parser/functions/basename.rb +++ b/lib/puppet/parser/functions/basename.rb @@ -2,7 +2,7 @@ # basename.rb # module Puppet::Parser::Functions - newfunction(:basename, type: :rvalue, doc: <<-EOS + newfunction(:basename, :type => :rvalue, :doc => <<-EOS Strips directory (and optional suffix) from a filename EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/bool2num.rb b/lib/puppet/parser/functions/bool2num.rb index a6abb44e5..6ee76f6f4 100644 --- a/lib/puppet/parser/functions/bool2num.rb +++ b/lib/puppet/parser/functions/bool2num.rb @@ -2,7 +2,7 @@ # bool2num.rb # module Puppet::Parser::Functions - newfunction(:bool2num, type: :rvalue, doc: <<-EOS + newfunction(:bool2num, :type => :rvalue, :doc => <<-EOS Converts a boolean to a number. Converts the values: false, f, 0, n, and no to 0 true, t, 1, y, and yes to 1 diff --git a/lib/puppet/parser/functions/bool2str.rb b/lib/puppet/parser/functions/bool2str.rb index 6cd833220..05f35d900 100644 --- a/lib/puppet/parser/functions/bool2str.rb +++ b/lib/puppet/parser/functions/bool2str.rb @@ -2,7 +2,7 @@ # bool2str.rb # module Puppet::Parser::Functions - newfunction(:bool2str, type: :rvalue, doc: <<-EOS + newfunction(:bool2str, :type => :rvalue, :doc => <<-EOS Converts a boolean to a string using optionally supplied arguments. The optional second and third arguments represent what true and false will be converted to respectively. If only one argument is given, it will be diff --git a/lib/puppet/parser/functions/camelcase.rb b/lib/puppet/parser/functions/camelcase.rb index 32a31856a..e8ff3c5c5 100644 --- a/lib/puppet/parser/functions/camelcase.rb +++ b/lib/puppet/parser/functions/camelcase.rb @@ -3,7 +3,7 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. # module Puppet::Parser::Functions - newfunction(:camelcase, type: :rvalue, doc: <<-EOS + newfunction(:camelcase, :type => :rvalue, :doc => <<-EOS Converts the case of a string or all strings in an array to camel case. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/capitalize.rb b/lib/puppet/parser/functions/capitalize.rb index 47db566f9..57a86b7b8 100644 --- a/lib/puppet/parser/functions/capitalize.rb +++ b/lib/puppet/parser/functions/capitalize.rb @@ -3,7 +3,7 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. # module Puppet::Parser::Functions - newfunction(:capitalize, type: :rvalue, doc: <<-EOS + newfunction(:capitalize, :type => :rvalue, :doc => <<-EOS Capitalizes the first letter of a string or array of strings. Requires either a single string or an array as an input. EOS diff --git a/lib/puppet/parser/functions/ceiling.rb b/lib/puppet/parser/functions/ceiling.rb index 51c163a05..3fd3bb022 100644 --- a/lib/puppet/parser/functions/ceiling.rb +++ b/lib/puppet/parser/functions/ceiling.rb @@ -2,7 +2,7 @@ # ceiling.rb # module Puppet::Parser::Functions - newfunction(:ceiling, type: :rvalue, doc: <<-EOS + newfunction(:ceiling, :type => :rvalue, :doc => <<-EOS Returns the smallest integer greater or equal to the argument. Takes a single numeric value as an argument. EOS diff --git a/lib/puppet/parser/functions/chomp.rb b/lib/puppet/parser/functions/chomp.rb index f950d9c06..a37718713 100644 --- a/lib/puppet/parser/functions/chomp.rb +++ b/lib/puppet/parser/functions/chomp.rb @@ -2,7 +2,7 @@ # chomp.rb # module Puppet::Parser::Functions - newfunction(:chomp, type: :rvalue, doc: <<-'EOS' + newfunction(:chomp, :type => :rvalue, :doc => <<-'EOS' Removes the record separator from the end of a string or an array of strings, for example `hello\n` becomes `hello`. Requires a single string or array as an input. diff --git a/lib/puppet/parser/functions/chop.rb b/lib/puppet/parser/functions/chop.rb index e5b258d0d..e01e17838 100644 --- a/lib/puppet/parser/functions/chop.rb +++ b/lib/puppet/parser/functions/chop.rb @@ -2,7 +2,7 @@ # chop.rb # module Puppet::Parser::Functions - newfunction(:chop, type: :rvalue, doc: <<-'EOS' + newfunction(:chop, :type => :rvalue, :doc => <<-'EOS' Returns a new string with the last character removed. If the string ends with `\r\n`, both characters are removed. Applying chop to an empty string returns an empty string. If you wish to merely remove record diff --git a/lib/puppet/parser/functions/clamp.rb b/lib/puppet/parser/functions/clamp.rb index f5e33c621..3527a5c35 100644 --- a/lib/puppet/parser/functions/clamp.rb +++ b/lib/puppet/parser/functions/clamp.rb @@ -2,7 +2,7 @@ # clamp.rb # module Puppet::Parser::Functions - newfunction(:clamp, type: :rvalue, arity: -2, doc: <<-EOS + newfunction(:clamp, :type => :rvalue, :arity => -2, :doc => <<-EOS Clamps value to a range. EOS ) do |args| diff --git a/lib/puppet/parser/functions/concat.rb b/lib/puppet/parser/functions/concat.rb index 401006999..435a88e9e 100644 --- a/lib/puppet/parser/functions/concat.rb +++ b/lib/puppet/parser/functions/concat.rb @@ -2,7 +2,7 @@ # concat.rb # module Puppet::Parser::Functions - newfunction(:concat, type: :rvalue, doc: <<-EOS + newfunction(:concat, :type => :rvalue, :doc => <<-EOS Appends the contents of multiple arrays into array 1. *Example:* diff --git a/lib/puppet/parser/functions/convert_base.rb b/lib/puppet/parser/functions/convert_base.rb index b5b10d875..8a1311dff 100644 --- a/lib/puppet/parser/functions/convert_base.rb +++ b/lib/puppet/parser/functions/convert_base.rb @@ -2,7 +2,7 @@ # convert_base.rb # module Puppet::Parser::Functions - newfunction(:convert_base, type: :rvalue, arity: 2, doc: <<-'ENDHEREDOC') do |args| + newfunction(:convert_base, :type => :rvalue, :arity => 2, :doc => <<-'ENDHEREDOC') do |args| Converts a given integer or base 10 string representing an integer to a specified base, as a string. Usage: diff --git a/lib/puppet/parser/functions/count.rb b/lib/puppet/parser/functions/count.rb index 1206ffee2..abbcecb2a 100644 --- a/lib/puppet/parser/functions/count.rb +++ b/lib/puppet/parser/functions/count.rb @@ -2,7 +2,7 @@ # count.rb # module Puppet::Parser::Functions - newfunction(:count, type: :rvalue, arity: -2, doc: <<-EOS + newfunction(:count, :type => :rvalue, :arity => -2, :doc => <<-EOS Takes an array as first argument and an optional second argument. Count the number of elements in array that matches second argument. If called with only an array it counts the number of elements that are not nil/undef. diff --git a/lib/puppet/parser/functions/deep_merge.rb b/lib/puppet/parser/functions/deep_merge.rb index af982a20e..267ef4b47 100644 --- a/lib/puppet/parser/functions/deep_merge.rb +++ b/lib/puppet/parser/functions/deep_merge.rb @@ -2,7 +2,7 @@ # deep_merge.rb # module Puppet::Parser::Functions - newfunction(:deep_merge, type: :rvalue, doc: <<-'ENDHEREDOC') do |args| + newfunction(:deep_merge, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| Recursively merges two or more hashes together and returns the resulting hash. For example: diff --git a/lib/puppet/parser/functions/defined_with_params.rb b/lib/puppet/parser/functions/defined_with_params.rb index 430fcdb91..d7c41c2d4 100644 --- a/lib/puppet/parser/functions/defined_with_params.rb +++ b/lib/puppet/parser/functions/defined_with_params.rb @@ -2,8 +2,8 @@ require 'puppet/parser/functions' Puppet::Parser::Functions.newfunction(:defined_with_params, - type: :rvalue, - doc: <<-'ENDOFDOC' + :type => :rvalue, + :doc => <<-'ENDOFDOC' Takes a resource reference and an optional hash of attributes. Returns true if a resource with the specified attributes has already been added diff --git a/lib/puppet/parser/functions/delete.rb b/lib/puppet/parser/functions/delete.rb index ee7885a24..ca3b17cd3 100644 --- a/lib/puppet/parser/functions/delete.rb +++ b/lib/puppet/parser/functions/delete.rb @@ -2,7 +2,7 @@ # delete.rb # module Puppet::Parser::Functions - newfunction(:delete, type: :rvalue, doc: <<-EOS + newfunction(:delete, :type => :rvalue, :doc => <<-EOS Deletes all instances of a given element from an array, substring from a string, or key from a hash. diff --git a/lib/puppet/parser/functions/delete_at.rb b/lib/puppet/parser/functions/delete_at.rb index 871c3512c..c96c45f8d 100644 --- a/lib/puppet/parser/functions/delete_at.rb +++ b/lib/puppet/parser/functions/delete_at.rb @@ -2,7 +2,7 @@ # delete_at.rb # module Puppet::Parser::Functions - newfunction(:delete_at, type: :rvalue, doc: <<-EOS + newfunction(:delete_at, :type => :rvalue, :doc => <<-EOS Deletes a determined indexed value from an array. *Examples:* diff --git a/lib/puppet/parser/functions/delete_regex.rb b/lib/puppet/parser/functions/delete_regex.rb index 76fca4d20..19f1cd6ac 100644 --- a/lib/puppet/parser/functions/delete_regex.rb +++ b/lib/puppet/parser/functions/delete_regex.rb @@ -3,7 +3,7 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. # module Puppet::Parser::Functions - newfunction(:delete_regex, type: :rvalue, doc: <<-EOS + newfunction(:delete_regex, :type => :rvalue, :doc => <<-EOS deletes all instances of a given element that match a regular expression from an array or key from a hash. Multiple regular expressions are assumed to be matched as an OR. diff --git a/lib/puppet/parser/functions/delete_undef_values.rb b/lib/puppet/parser/functions/delete_undef_values.rb index b43601be7..8a1841e5c 100644 --- a/lib/puppet/parser/functions/delete_undef_values.rb +++ b/lib/puppet/parser/functions/delete_undef_values.rb @@ -2,7 +2,7 @@ # delete_undef_values.rb # module Puppet::Parser::Functions - newfunction(:delete_undef_values, type: :rvalue, doc: <<-EOS + newfunction(:delete_undef_values, :type => :rvalue, :doc => <<-EOS Returns a copy of input hash or array with all undefs deleted. *Examples:* diff --git a/lib/puppet/parser/functions/delete_values.rb b/lib/puppet/parser/functions/delete_values.rb index dcb608b9b..4544ba740 100644 --- a/lib/puppet/parser/functions/delete_values.rb +++ b/lib/puppet/parser/functions/delete_values.rb @@ -2,7 +2,7 @@ # delete_values.rb # module Puppet::Parser::Functions - newfunction(:delete_values, type: :rvalue, doc: <<-EOS + newfunction(:delete_values, :type => :rvalue, :doc => <<-EOS Deletes all instances of a given value from a hash. *Examples:* diff --git a/lib/puppet/parser/functions/deprecation.rb b/lib/puppet/parser/functions/deprecation.rb index 4b587904d..b1ae0e76a 100644 --- a/lib/puppet/parser/functions/deprecation.rb +++ b/lib/puppet/parser/functions/deprecation.rb @@ -2,7 +2,7 @@ # deprecation.rb # module Puppet::Parser::Functions - newfunction(:deprecation, doc: <<-EOS + newfunction(:deprecation, :doc => <<-EOS Function to print deprecation warnings (this is the 3.X version of it), The uniqueness key - can appear once. The msg is the message text including any positional information that is formatted by the user/caller of the method.). EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/difference.rb b/lib/puppet/parser/functions/difference.rb index 01e7f832b..a7510415b 100644 --- a/lib/puppet/parser/functions/difference.rb +++ b/lib/puppet/parser/functions/difference.rb @@ -2,7 +2,7 @@ # difference.rb # module Puppet::Parser::Functions - newfunction(:difference, type: :rvalue, doc: <<-EOS + newfunction(:difference, :type => :rvalue, :doc => <<-EOS This function returns the difference between two arrays. The returned array is a copy of the original array, removing any items that also appear in the second array. diff --git a/lib/puppet/parser/functions/dig.rb b/lib/puppet/parser/functions/dig.rb index 44002b106..c9cf5fc26 100644 --- a/lib/puppet/parser/functions/dig.rb +++ b/lib/puppet/parser/functions/dig.rb @@ -2,7 +2,7 @@ # dig.rb # module Puppet::Parser::Functions - newfunction(:dig, type: :rvalue, doc: <<-EOS + newfunction(:dig, :type => :rvalue, :doc => <<-EOS DEPRECATED: This function has been replaced in Puppet 4.5.0, please use dig44() for backwards compatibility or use the new version. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/dig44.rb b/lib/puppet/parser/functions/dig44.rb index 0fe5f0295..9eaa70f94 100644 --- a/lib/puppet/parser/functions/dig44.rb +++ b/lib/puppet/parser/functions/dig44.rb @@ -4,9 +4,9 @@ module Puppet::Parser::Functions newfunction( :dig44, - type: :rvalue, - arity: -2, - doc: <<-eos + :type => :rvalue, + :arity => -2, + :doc => <<-eos DEPRECATED: This function has been replaced in puppet 4.5.0. Looks up into a complex structure of arrays and hashes and returns a value diff --git a/lib/puppet/parser/functions/dirname.rb b/lib/puppet/parser/functions/dirname.rb index e02433e3d..ec95e9d49 100644 --- a/lib/puppet/parser/functions/dirname.rb +++ b/lib/puppet/parser/functions/dirname.rb @@ -2,7 +2,7 @@ # dirname.rb # module Puppet::Parser::Functions - newfunction(:dirname, type: :rvalue, doc: <<-EOS + newfunction(:dirname, :type => :rvalue, :doc => <<-EOS Returns the dirname of a path. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/dos2unix.rb b/lib/puppet/parser/functions/dos2unix.rb index 33df5e592..3ee0198a2 100644 --- a/lib/puppet/parser/functions/dos2unix.rb +++ b/lib/puppet/parser/functions/dos2unix.rb @@ -1,6 +1,6 @@ # Custom Puppet function to convert dos to unix format module Puppet::Parser::Functions - newfunction(:dos2unix, type: :rvalue, arity: 1, doc: <<-EOS + newfunction(:dos2unix, :type => :rvalue, :arity => 1, :doc => <<-EOS Returns the Unix version of the given string. Takes a single string argument. EOS diff --git a/lib/puppet/parser/functions/downcase.rb b/lib/puppet/parser/functions/downcase.rb index e56df7501..1367c7245 100644 --- a/lib/puppet/parser/functions/downcase.rb +++ b/lib/puppet/parser/functions/downcase.rb @@ -3,7 +3,7 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. # module Puppet::Parser::Functions - newfunction(:downcase, type: :rvalue, doc: <<-EOS + newfunction(:downcase, :type => :rvalue, :doc => <<-EOS Converts the case of a string or all strings in an array to lower case. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/empty.rb b/lib/puppet/parser/functions/empty.rb index f4c4af2f4..9fe46c112 100644 --- a/lib/puppet/parser/functions/empty.rb +++ b/lib/puppet/parser/functions/empty.rb @@ -2,7 +2,7 @@ # empty.rb # module Puppet::Parser::Functions - newfunction(:empty, type: :rvalue, doc: <<-EOS + newfunction(:empty, :type => :rvalue, :doc => <<-EOS Returns true if the variable is empty. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/enclose_ipv6.rb b/lib/puppet/parser/functions/enclose_ipv6.rb index 3b288d375..5a633c81b 100644 --- a/lib/puppet/parser/functions/enclose_ipv6.rb +++ b/lib/puppet/parser/functions/enclose_ipv6.rb @@ -2,7 +2,7 @@ # enclose_ipv6.rb # module Puppet::Parser::Functions - newfunction(:enclose_ipv6, type: :rvalue, doc: <<-EOS + newfunction(:enclose_ipv6, :type => :rvalue, :doc => <<-EOS Takes an array of ip addresses and encloses the ipv6 addresses with square brackets. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/ensure_packages.rb b/lib/puppet/parser/functions/ensure_packages.rb index 9fcf06b4d..f3fd7bb71 100644 --- a/lib/puppet/parser/functions/ensure_packages.rb +++ b/lib/puppet/parser/functions/ensure_packages.rb @@ -2,7 +2,7 @@ # ensure_packages.rb # module Puppet::Parser::Functions - newfunction(:ensure_packages, type: :statement, doc: <<-EOS + newfunction(:ensure_packages, :type => :statement, :doc => <<-EOS Takes a list of packages and only installs them if they don't already exist. It optionally takes a hash as a second parameter that will be passed as the third argument to the ensure_resource() function. diff --git a/lib/puppet/parser/functions/ensure_resource.rb b/lib/puppet/parser/functions/ensure_resource.rb index 8d9902aec..8ba6d7ca0 100644 --- a/lib/puppet/parser/functions/ensure_resource.rb +++ b/lib/puppet/parser/functions/ensure_resource.rb @@ -2,8 +2,8 @@ require 'puppet/parser/functions' Puppet::Parser::Functions.newfunction(:ensure_resource, - type: :statement, - doc: <<-'ENDOFDOC' + :type => :statement, + :doc => <<-'ENDOFDOC' Takes a resource type, title, and a list of attributes that describe a resource. diff --git a/lib/puppet/parser/functions/ensure_resources.rb b/lib/puppet/parser/functions/ensure_resources.rb index f925f8162..6b0ee5499 100644 --- a/lib/puppet/parser/functions/ensure_resources.rb +++ b/lib/puppet/parser/functions/ensure_resources.rb @@ -1,8 +1,8 @@ require 'puppet/parser/functions' Puppet::Parser::Functions.newfunction(:ensure_resources, - type: :statement, - doc: <<-'ENDOFDOC' + :type => :statement, + :doc => <<-'ENDOFDOC' Takes a resource type, title (only hash), and a list of attributes that describe a resource. diff --git a/lib/puppet/parser/functions/flatten.rb b/lib/puppet/parser/functions/flatten.rb index 694694465..d2e1912ed 100644 --- a/lib/puppet/parser/functions/flatten.rb +++ b/lib/puppet/parser/functions/flatten.rb @@ -2,7 +2,7 @@ # flatten.rb # module Puppet::Parser::Functions - newfunction(:flatten, type: :rvalue, doc: <<-EOS + newfunction(:flatten, :type => :rvalue, :doc => <<-EOS This function flattens any deeply nested arrays and returns a single flat array as a result. diff --git a/lib/puppet/parser/functions/floor.rb b/lib/puppet/parser/functions/floor.rb index 99836b4ab..b545011bf 100644 --- a/lib/puppet/parser/functions/floor.rb +++ b/lib/puppet/parser/functions/floor.rb @@ -2,7 +2,7 @@ # floor.rb # module Puppet::Parser::Functions - newfunction(:floor, type: :rvalue, doc: <<-EOS + newfunction(:floor, :type => :rvalue, :doc => <<-EOS Returns the largest integer less or equal to the argument. Takes a single numeric value as an argument. EOS diff --git a/lib/puppet/parser/functions/fqdn_rand_string.rb b/lib/puppet/parser/functions/fqdn_rand_string.rb index f404d69f0..ee45236b3 100644 --- a/lib/puppet/parser/functions/fqdn_rand_string.rb +++ b/lib/puppet/parser/functions/fqdn_rand_string.rb @@ -1,8 +1,8 @@ Puppet::Parser::Functions.newfunction( :fqdn_rand_string, - arity: -2, - type: :rvalue, - doc: "Usage: `fqdn_rand_string(LENGTH, [CHARSET], [SEED])`. LENGTH is + :arity => -2, + :type => :rvalue, + :doc => "Usage: `fqdn_rand_string(LENGTH, [CHARSET], [SEED])`. LENGTH is required and must be a positive integer. CHARSET is optional and may be `undef` or a string. SEED is optional and may be any number or string. diff --git a/lib/puppet/parser/functions/fqdn_rotate.rb b/lib/puppet/parser/functions/fqdn_rotate.rb index 3c201fdbe..879e44bbc 100644 --- a/lib/puppet/parser/functions/fqdn_rotate.rb +++ b/lib/puppet/parser/functions/fqdn_rotate.rb @@ -3,8 +3,8 @@ # Puppet::Parser::Functions.newfunction( :fqdn_rotate, - type: :rvalue, - doc: "Usage: `fqdn_rotate(VALUE, [SEED])`. VALUE is required and + :type => :rvalue, + :doc => "Usage: `fqdn_rotate(VALUE, [SEED])`. VALUE is required and must be an array or a string. SEED is optional and may be any number or string. diff --git a/lib/puppet/parser/functions/fqdn_uuid.rb b/lib/puppet/parser/functions/fqdn_uuid.rb index c40112250..da9f7a982 100644 --- a/lib/puppet/parser/functions/fqdn_uuid.rb +++ b/lib/puppet/parser/functions/fqdn_uuid.rb @@ -3,7 +3,7 @@ # fqdn_uuid.rb # module Puppet::Parser::Functions - newfunction(:fqdn_uuid, type: :rvalue, doc: <<-END) do |args| + newfunction(:fqdn_uuid, :type => :rvalue, :doc => <<-END) do |args| Creates a UUID based on a given string, assumed to be the FQDN For example, to generate a UUID based on the FQDN of a system: diff --git a/lib/puppet/parser/functions/get_module_path.rb b/lib/puppet/parser/functions/get_module_path.rb index 215d97886..eac8906a1 100644 --- a/lib/puppet/parser/functions/get_module_path.rb +++ b/lib/puppet/parser/functions/get_module_path.rb @@ -2,7 +2,7 @@ # get_module_path.rb # module Puppet::Parser::Functions - newfunction(:get_module_path, type: :rvalue, doc: <<-EOT + newfunction(:get_module_path, :type => :rvalue, :doc => <<-EOT Returns the absolute path of the specified module for the current environment. diff --git a/lib/puppet/parser/functions/getparam.rb b/lib/puppet/parser/functions/getparam.rb index 0431b88dc..62399250c 100644 --- a/lib/puppet/parser/functions/getparam.rb +++ b/lib/puppet/parser/functions/getparam.rb @@ -2,8 +2,8 @@ require 'puppet/parser/functions' Puppet::Parser::Functions.newfunction(:getparam, - type: :rvalue, - doc: <<-'ENDOFDOC' + :type => :rvalue, + :doc => <<-'ENDOFDOC' Takes a resource reference and name of the parameter and returns value of resource's parameter. diff --git a/lib/puppet/parser/functions/getvar.rb b/lib/puppet/parser/functions/getvar.rb index 935ca8d6c..8c69c36cf 100644 --- a/lib/puppet/parser/functions/getvar.rb +++ b/lib/puppet/parser/functions/getvar.rb @@ -2,7 +2,7 @@ # getvar.rb # module Puppet::Parser::Functions - newfunction(:getvar, type: :rvalue, doc: <<-'ENDHEREDOC') do |args| + newfunction(:getvar, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| Lookup a variable in a remote namespace. For example: diff --git a/lib/puppet/parser/functions/glob.rb b/lib/puppet/parser/functions/glob.rb index dd803a995..c19195a65 100644 --- a/lib/puppet/parser/functions/glob.rb +++ b/lib/puppet/parser/functions/glob.rb @@ -2,7 +2,7 @@ # glob.rb # module Puppet::Parser::Functions - newfunction(:glob, type: :rvalue, doc: <<-'EOS' + newfunction(:glob, :type => :rvalue, :doc => <<-'EOS' Returns an Array of file entries of a directory or an Array of directories. Uses same patterns as Dir#glob EOS diff --git a/lib/puppet/parser/functions/grep.rb b/lib/puppet/parser/functions/grep.rb index 3aec06ec6..915592efe 100644 --- a/lib/puppet/parser/functions/grep.rb +++ b/lib/puppet/parser/functions/grep.rb @@ -2,7 +2,7 @@ # grep.rb # module Puppet::Parser::Functions - newfunction(:grep, type: :rvalue, doc: <<-EOS + newfunction(:grep, :type => :rvalue, :doc => <<-EOS This function searches through an array and returns any elements that match the provided regular expression. diff --git a/lib/puppet/parser/functions/has_interface_with.rb b/lib/puppet/parser/functions/has_interface_with.rb index aa3c3b0c7..babe1fce4 100644 --- a/lib/puppet/parser/functions/has_interface_with.rb +++ b/lib/puppet/parser/functions/has_interface_with.rb @@ -2,7 +2,7 @@ # has_interface_with # module Puppet::Parser::Functions - newfunction(:has_interface_with, type: :rvalue, doc: <<-EOS + newfunction(:has_interface_with, :type => :rvalue, :doc => <<-EOS Returns boolean based on kind and value: * macaddress * netmask diff --git a/lib/puppet/parser/functions/has_ip_address.rb b/lib/puppet/parser/functions/has_ip_address.rb index ac069c821..303dcd940 100644 --- a/lib/puppet/parser/functions/has_ip_address.rb +++ b/lib/puppet/parser/functions/has_ip_address.rb @@ -2,7 +2,7 @@ # has_ip_address # module Puppet::Parser::Functions - newfunction(:has_ip_address, type: :rvalue, doc: <<-EOS + newfunction(:has_ip_address, :type => :rvalue, :doc => <<-EOS Returns true if the client has the requested IP address on some interface. This function iterates through the 'interfaces' fact and checks the diff --git a/lib/puppet/parser/functions/has_ip_network.rb b/lib/puppet/parser/functions/has_ip_network.rb index f8e8e85fc..2ee594527 100644 --- a/lib/puppet/parser/functions/has_ip_network.rb +++ b/lib/puppet/parser/functions/has_ip_network.rb @@ -2,7 +2,7 @@ # has_ip_network # module Puppet::Parser::Functions - newfunction(:has_ip_network, type: :rvalue, doc: <<-EOS + newfunction(:has_ip_network, :type => :rvalue, :doc => <<-EOS Returns true if the client has an IP address within the requested network. This function iterates through the 'interfaces' fact and checks the diff --git a/lib/puppet/parser/functions/has_key.rb b/lib/puppet/parser/functions/has_key.rb index b80923db0..5597b867e 100644 --- a/lib/puppet/parser/functions/has_key.rb +++ b/lib/puppet/parser/functions/has_key.rb @@ -2,7 +2,7 @@ # has_key.rb # module Puppet::Parser::Functions - newfunction(:has_key, type: :rvalue, doc: <<-'ENDHEREDOC') do |args| + newfunction(:has_key, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| Determine if a hash has a certain key value. Example: diff --git a/lib/puppet/parser/functions/hash.rb b/lib/puppet/parser/functions/hash.rb index 472afb6aa..04340be88 100644 --- a/lib/puppet/parser/functions/hash.rb +++ b/lib/puppet/parser/functions/hash.rb @@ -2,7 +2,7 @@ # hash.rb # module Puppet::Parser::Functions - newfunction(:hash, type: :rvalue, doc: <<-EOS + newfunction(:hash, :type => :rvalue, :doc => <<-EOS This function converts an array into a hash. *Examples:* diff --git a/lib/puppet/parser/functions/intersection.rb b/lib/puppet/parser/functions/intersection.rb index 338daf8fb..1d80f5eed 100644 --- a/lib/puppet/parser/functions/intersection.rb +++ b/lib/puppet/parser/functions/intersection.rb @@ -2,7 +2,7 @@ # intersection.rb # module Puppet::Parser::Functions - newfunction(:intersection, type: :rvalue, doc: <<-EOS + newfunction(:intersection, :type => :rvalue, :doc => <<-EOS This function returns an array of the intersection of two. *Examples:* diff --git a/lib/puppet/parser/functions/is_absolute_path.rb b/lib/puppet/parser/functions/is_absolute_path.rb index ebb913e4e..43d5308da 100644 --- a/lib/puppet/parser/functions/is_absolute_path.rb +++ b/lib/puppet/parser/functions/is_absolute_path.rb @@ -2,7 +2,7 @@ # is_absolute_path.rb # module Puppet::Parser::Functions - newfunction(:is_absolute_path, type: :rvalue, arity: 1, doc: <<-'ENDHEREDOC') do |args| + newfunction(:is_absolute_path, :type => :rvalue, :arity => 1, :doc => <<-'ENDHEREDOC') do |args| Returns boolean true if the string represents an absolute path in the filesystem. This function works for windows and unix style paths. @@ -44,8 +44,8 @@ module Puppet::Parser::Functions slash = '[\\\\/]' name = '[^\\\\/]+' regexes = { - windows: %r{^(([A-Z]:#{slash})|(#{slash}#{slash}#{name}#{slash}#{name})|(#{slash}#{slash}\?#{slash}#{name}))}i, - posix: %r{^/}, + :windows => %r{^(([A-Z]:#{slash})|(#{slash}#{slash}#{name}#{slash}#{name})|(#{slash}#{slash}\?#{slash}#{name}))}i, + :posix => %r{^/}, } value = !!(path =~ regexes[:posix]) || !!(path =~ regexes[:windows]) # rubocop:disable Style/DoubleNegation : No alternative known end diff --git a/lib/puppet/parser/functions/is_array.rb b/lib/puppet/parser/functions/is_array.rb index 3a394382f..47643c426 100644 --- a/lib/puppet/parser/functions/is_array.rb +++ b/lib/puppet/parser/functions/is_array.rb @@ -2,7 +2,7 @@ # is_array.rb # module Puppet::Parser::Functions - newfunction(:is_array, type: :rvalue, doc: <<-EOS + newfunction(:is_array, :type => :rvalue, :doc => <<-EOS Returns true if the variable passed to this function is an array. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/is_bool.rb b/lib/puppet/parser/functions/is_bool.rb index 6897605d0..f00f4102a 100644 --- a/lib/puppet/parser/functions/is_bool.rb +++ b/lib/puppet/parser/functions/is_bool.rb @@ -2,7 +2,7 @@ # is_bool.rb # module Puppet::Parser::Functions - newfunction(:is_bool, type: :rvalue, doc: <<-EOS + newfunction(:is_bool, :type => :rvalue, :doc => <<-EOS Returns true if the variable passed to this function is a boolean. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/is_domain_name.rb b/lib/puppet/parser/functions/is_domain_name.rb index 38aeecf9d..82d5e9c15 100644 --- a/lib/puppet/parser/functions/is_domain_name.rb +++ b/lib/puppet/parser/functions/is_domain_name.rb @@ -2,7 +2,7 @@ # is_domain_name.rb # module Puppet::Parser::Functions - newfunction(:is_domain_name, type: :rvalue, doc: <<-EOS + newfunction(:is_domain_name, :type => :rvalue, :doc => <<-EOS Returns true if the string passed to this function is a syntactically correct domain name. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/is_email_address.rb b/lib/puppet/parser/functions/is_email_address.rb index c47f31664..3225e93be 100644 --- a/lib/puppet/parser/functions/is_email_address.rb +++ b/lib/puppet/parser/functions/is_email_address.rb @@ -2,7 +2,7 @@ # is_email_address.rb # module Puppet::Parser::Functions - newfunction(:is_email_address, type: :rvalue, doc: <<-EOS + newfunction(:is_email_address, :type => :rvalue, :doc => <<-EOS Returns true if the string passed to this function is a valid email address. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/is_float.rb b/lib/puppet/parser/functions/is_float.rb index fcce6ed32..c80a04eae 100644 --- a/lib/puppet/parser/functions/is_float.rb +++ b/lib/puppet/parser/functions/is_float.rb @@ -2,7 +2,7 @@ # is_float.rb # module Puppet::Parser::Functions - newfunction(:is_float, type: :rvalue, doc: <<-EOS + newfunction(:is_float, :type => :rvalue, :doc => <<-EOS Returns true if the variable passed to this function is a float. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/is_function_available.rb b/lib/puppet/parser/functions/is_function_available.rb index a1e958df1..f47ff8be8 100644 --- a/lib/puppet/parser/functions/is_function_available.rb +++ b/lib/puppet/parser/functions/is_function_available.rb @@ -2,7 +2,7 @@ # is_function_available.rb # module Puppet::Parser::Functions - newfunction(:is_function_available, type: :rvalue, doc: <<-EOS + newfunction(:is_function_available, :type => :rvalue, :doc => <<-EOS This function accepts a string as an argument, determines whether the Puppet runtime has access to a function by that name. It returns a true if the function exists, false if not. diff --git a/lib/puppet/parser/functions/is_hash.rb b/lib/puppet/parser/functions/is_hash.rb index 3362c71d8..9e7450515 100644 --- a/lib/puppet/parser/functions/is_hash.rb +++ b/lib/puppet/parser/functions/is_hash.rb @@ -2,7 +2,7 @@ # is_hash.rb # module Puppet::Parser::Functions - newfunction(:is_hash, type: :rvalue, doc: <<-EOS + newfunction(:is_hash, :type => :rvalue, :doc => <<-EOS Returns true if the variable passed to this function is a hash. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/is_integer.rb b/lib/puppet/parser/functions/is_integer.rb index 509921950..fd767956e 100644 --- a/lib/puppet/parser/functions/is_integer.rb +++ b/lib/puppet/parser/functions/is_integer.rb @@ -2,7 +2,7 @@ # is_integer.rb # module Puppet::Parser::Functions - newfunction(:is_integer, type: :rvalue, doc: <<-EOS + newfunction(:is_integer, :type => :rvalue, :doc => <<-EOS Returns true if the variable passed to this function is an Integer or a decimal (base 10) integer in String form. The string may start with a '-' (minus). A value of '0' is allowed, but a leading '0' digit may not diff --git a/lib/puppet/parser/functions/is_ip_address.rb b/lib/puppet/parser/functions/is_ip_address.rb index 697537ad8..064fea42d 100644 --- a/lib/puppet/parser/functions/is_ip_address.rb +++ b/lib/puppet/parser/functions/is_ip_address.rb @@ -2,7 +2,7 @@ # is_ip_address.rb # module Puppet::Parser::Functions - newfunction(:is_ip_address, type: :rvalue, doc: <<-EOS + newfunction(:is_ip_address, :type => :rvalue, :doc => <<-EOS Returns true if the string passed to this function is a valid IP address. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/is_ipv4_address.rb b/lib/puppet/parser/functions/is_ipv4_address.rb index 93dcb24f7..8d93f1492 100644 --- a/lib/puppet/parser/functions/is_ipv4_address.rb +++ b/lib/puppet/parser/functions/is_ipv4_address.rb @@ -2,7 +2,7 @@ # is_ipv4_address.rb # module Puppet::Parser::Functions - newfunction(:is_ipv4_address, type: :rvalue, doc: <<-EOS + newfunction(:is_ipv4_address, :type => :rvalue, :doc => <<-EOS Returns true if the string passed to this function is a valid IPv4 address. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/is_ipv6_address.rb b/lib/puppet/parser/functions/is_ipv6_address.rb index d898f949e..5fe2bb35d 100644 --- a/lib/puppet/parser/functions/is_ipv6_address.rb +++ b/lib/puppet/parser/functions/is_ipv6_address.rb @@ -2,7 +2,7 @@ # is_ipv6_address.rb # module Puppet::Parser::Functions - newfunction(:is_ipv6_address, type: :rvalue, doc: <<-EOS + newfunction(:is_ipv6_address, :type => :rvalue, :doc => <<-EOS Returns true if the string passed to this function is a valid IPv6 address. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/is_mac_address.rb b/lib/puppet/parser/functions/is_mac_address.rb index f110edf52..11c3ac7cf 100644 --- a/lib/puppet/parser/functions/is_mac_address.rb +++ b/lib/puppet/parser/functions/is_mac_address.rb @@ -2,7 +2,7 @@ # is_mac_address.rb # module Puppet::Parser::Functions - newfunction(:is_mac_address, type: :rvalue, doc: <<-EOS + newfunction(:is_mac_address, :type => :rvalue, :doc => <<-EOS Returns true if the string passed to this function is a valid mac address. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/is_numeric.rb b/lib/puppet/parser/functions/is_numeric.rb index 30105a997..f20ec69ed 100644 --- a/lib/puppet/parser/functions/is_numeric.rb +++ b/lib/puppet/parser/functions/is_numeric.rb @@ -2,7 +2,7 @@ # is_numeric.rb # module Puppet::Parser::Functions - newfunction(:is_numeric, type: :rvalue, doc: <<-EOS + newfunction(:is_numeric, :type => :rvalue, :doc => <<-EOS Returns true if the given argument is a Numeric (Integer or Float), or a String containing either a valid integer in decimal base 10 form, or a valid floating point string representation. diff --git a/lib/puppet/parser/functions/is_string.rb b/lib/puppet/parser/functions/is_string.rb index 9e0e47d47..7cc9e0b2f 100644 --- a/lib/puppet/parser/functions/is_string.rb +++ b/lib/puppet/parser/functions/is_string.rb @@ -2,7 +2,7 @@ # is_string.rb # module Puppet::Parser::Functions - newfunction(:is_string, type: :rvalue, doc: <<-EOS + newfunction(:is_string, :type => :rvalue, :doc => <<-EOS Returns true if the variable passed to this function is a string. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/join.rb b/lib/puppet/parser/functions/join.rb index 0fdc0013b..5d26add0f 100644 --- a/lib/puppet/parser/functions/join.rb +++ b/lib/puppet/parser/functions/join.rb @@ -2,7 +2,7 @@ # join.rb # module Puppet::Parser::Functions - newfunction(:join, type: :rvalue, doc: <<-EOS + newfunction(:join, :type => :rvalue, :doc => <<-EOS This function joins an array into a string using a separator. *Examples:* diff --git a/lib/puppet/parser/functions/join_keys_to_values.rb b/lib/puppet/parser/functions/join_keys_to_values.rb index 8c6a83648..5335d3539 100644 --- a/lib/puppet/parser/functions/join_keys_to_values.rb +++ b/lib/puppet/parser/functions/join_keys_to_values.rb @@ -2,7 +2,7 @@ # join.rb # module Puppet::Parser::Functions - newfunction(:join_keys_to_values, type: :rvalue, doc: <<-EOS + newfunction(:join_keys_to_values, :type => :rvalue, :doc => <<-EOS This function joins each key of a hash to that key's corresponding value with a separator. Keys are cast to strings. If values are arrays, multiple keys are added for each element. The return value is an array in diff --git a/lib/puppet/parser/functions/keys.rb b/lib/puppet/parser/functions/keys.rb index ccf5c6270..ebf311712 100644 --- a/lib/puppet/parser/functions/keys.rb +++ b/lib/puppet/parser/functions/keys.rb @@ -2,7 +2,7 @@ # keys.rb # module Puppet::Parser::Functions - newfunction(:keys, type: :rvalue, doc: <<-EOS + newfunction(:keys, :type => :rvalue, :doc => <<-EOS Returns the keys of a hash as an array. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/load_module_metadata.rb b/lib/puppet/parser/functions/load_module_metadata.rb index a2c5fa088..2b7c11f94 100644 --- a/lib/puppet/parser/functions/load_module_metadata.rb +++ b/lib/puppet/parser/functions/load_module_metadata.rb @@ -2,7 +2,7 @@ # load_module_metadata.rb # module Puppet::Parser::Functions - newfunction(:load_module_metadata, type: :rvalue, doc: <<-EOT + newfunction(:load_module_metadata, :type => :rvalue, :doc => <<-EOT This function loads the metadata of a given module. EOT ) do |args| diff --git a/lib/puppet/parser/functions/loadjson.rb b/lib/puppet/parser/functions/loadjson.rb index 535152d51..c7bfd734f 100644 --- a/lib/puppet/parser/functions/loadjson.rb +++ b/lib/puppet/parser/functions/loadjson.rb @@ -2,7 +2,7 @@ # loadjson.rb # module Puppet::Parser::Functions - newfunction(:loadjson, type: :rvalue, arity: -2, doc: <<-'ENDHEREDOC') do |args| + newfunction(:loadjson, :type => :rvalue, :arity => -2, :doc => <<-'ENDHEREDOC') do |args| Load a JSON file containing an array, string, or hash, and return the data in the corresponding native data type. The second parameter is the default value. It will be returned if the file diff --git a/lib/puppet/parser/functions/loadyaml.rb b/lib/puppet/parser/functions/loadyaml.rb index 3cfed4bde..330bd0e8b 100644 --- a/lib/puppet/parser/functions/loadyaml.rb +++ b/lib/puppet/parser/functions/loadyaml.rb @@ -2,7 +2,7 @@ # loadyaml.rb # module Puppet::Parser::Functions - newfunction(:loadyaml, type: :rvalue, arity: -2, doc: <<-'ENDHEREDOC') do |args| + newfunction(:loadyaml, :type => :rvalue, :arity => -2, :doc => <<-'ENDHEREDOC') do |args| Load a YAML file containing an array, string, or hash, and return the data in the corresponding native data type. The second parameter is the default value. It will be returned if the file diff --git a/lib/puppet/parser/functions/lstrip.rb b/lib/puppet/parser/functions/lstrip.rb index b729bed97..d3403ad5e 100644 --- a/lib/puppet/parser/functions/lstrip.rb +++ b/lib/puppet/parser/functions/lstrip.rb @@ -2,7 +2,7 @@ # lstrip.rb # module Puppet::Parser::Functions - newfunction(:lstrip, type: :rvalue, doc: <<-EOS + newfunction(:lstrip, :type => :rvalue, :doc => <<-EOS Strips leading spaces to the left of a string. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/max.rb b/lib/puppet/parser/functions/max.rb index df594d92d..517dfae20 100644 --- a/lib/puppet/parser/functions/max.rb +++ b/lib/puppet/parser/functions/max.rb @@ -2,7 +2,7 @@ # max.rb # module Puppet::Parser::Functions - newfunction(:max, type: :rvalue, doc: <<-EOS + newfunction(:max, :type => :rvalue, :doc => <<-EOS Returns the highest value of all arguments. Requires at least one argument. EOS diff --git a/lib/puppet/parser/functions/member.rb b/lib/puppet/parser/functions/member.rb index 0bd408465..4d746d249 100644 --- a/lib/puppet/parser/functions/member.rb +++ b/lib/puppet/parser/functions/member.rb @@ -4,7 +4,7 @@ # member.rb # module Puppet::Parser::Functions - newfunction(:member, type: :rvalue, doc: <<-EOS + newfunction(:member, :type => :rvalue, :doc => <<-EOS This function determines if a variable is a member of an array. The variable can be a string, fixnum, or array. diff --git a/lib/puppet/parser/functions/merge.rb b/lib/puppet/parser/functions/merge.rb index 37154bc3d..b16cd06ac 100644 --- a/lib/puppet/parser/functions/merge.rb +++ b/lib/puppet/parser/functions/merge.rb @@ -2,7 +2,7 @@ # merge.rb # module Puppet::Parser::Functions - newfunction(:merge, type: :rvalue, doc: <<-'ENDHEREDOC') do |args| + newfunction(:merge, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| Merges two or more hashes together and returns the resulting hash. For example: diff --git a/lib/puppet/parser/functions/min.rb b/lib/puppet/parser/functions/min.rb index 712902dc3..238444308 100644 --- a/lib/puppet/parser/functions/min.rb +++ b/lib/puppet/parser/functions/min.rb @@ -2,7 +2,7 @@ # min.rb # module Puppet::Parser::Functions - newfunction(:min, type: :rvalue, doc: <<-EOS + newfunction(:min, :type => :rvalue, :doc => <<-EOS Returns the lowest value of all arguments. Requires at least one argument. EOS diff --git a/lib/puppet/parser/functions/num2bool.rb b/lib/puppet/parser/functions/num2bool.rb index 1860c8bbc..cd6b0f306 100644 --- a/lib/puppet/parser/functions/num2bool.rb +++ b/lib/puppet/parser/functions/num2bool.rb @@ -2,7 +2,7 @@ # num2bool.rb # module Puppet::Parser::Functions - newfunction(:num2bool, type: :rvalue, doc: <<-EOS + newfunction(:num2bool, :type => :rvalue, :doc => <<-EOS This function converts a number or a string representation of a number into a true boolean. Zero or anything non-numeric becomes false. Numbers higher then 0 become true. diff --git a/lib/puppet/parser/functions/parsejson.rb b/lib/puppet/parser/functions/parsejson.rb index 1117d03da..f33a5fb49 100644 --- a/lib/puppet/parser/functions/parsejson.rb +++ b/lib/puppet/parser/functions/parsejson.rb @@ -2,7 +2,7 @@ # parsejson.rb # module Puppet::Parser::Functions - newfunction(:parsejson, type: :rvalue, doc: <<-EOS + newfunction(:parsejson, :type => :rvalue, :doc => <<-EOS This function accepts JSON as a string and converts it into the correct Puppet structure. diff --git a/lib/puppet/parser/functions/parseyaml.rb b/lib/puppet/parser/functions/parseyaml.rb index 33c86961e..35a2f2c0d 100644 --- a/lib/puppet/parser/functions/parseyaml.rb +++ b/lib/puppet/parser/functions/parseyaml.rb @@ -2,7 +2,7 @@ # parseyaml.rb # module Puppet::Parser::Functions - newfunction(:parseyaml, type: :rvalue, doc: <<-EOS + newfunction(:parseyaml, :type => :rvalue, :doc => <<-EOS This function accepts YAML as a string and converts it into the correct Puppet structure. diff --git a/lib/puppet/parser/functions/pick.rb b/lib/puppet/parser/functions/pick.rb index d68791cd8..70995de50 100644 --- a/lib/puppet/parser/functions/pick.rb +++ b/lib/puppet/parser/functions/pick.rb @@ -2,7 +2,7 @@ # pick.rb # module Puppet::Parser::Functions - newfunction(:pick, type: :rvalue, doc: <<-EOS + newfunction(:pick, :type => :rvalue, :doc => <<-EOS This function is similar to a coalesce function in SQL in that it will return the first value in a list of values that is not undefined or an empty string (two things in Puppet that will return a boolean false value). Typically, diff --git a/lib/puppet/parser/functions/pick_default.rb b/lib/puppet/parser/functions/pick_default.rb index 05ac8ca4a..eba40d546 100644 --- a/lib/puppet/parser/functions/pick_default.rb +++ b/lib/puppet/parser/functions/pick_default.rb @@ -2,7 +2,7 @@ # pick_default.rb # module Puppet::Parser::Functions - newfunction(:pick_default, type: :rvalue, doc: <<-EOS + newfunction(:pick_default, :type => :rvalue, :doc => <<-EOS This function is similar to a coalesce function in SQL in that it will return the first value in a list of values that is not undefined or an empty string (two things in Puppet that will return a boolean false value). If no value is diff --git a/lib/puppet/parser/functions/prefix.rb b/lib/puppet/parser/functions/prefix.rb index 285a3ceec..214959877 100644 --- a/lib/puppet/parser/functions/prefix.rb +++ b/lib/puppet/parser/functions/prefix.rb @@ -2,7 +2,7 @@ # prefix.rb # module Puppet::Parser::Functions - newfunction(:prefix, type: :rvalue, doc: <<-EOS + newfunction(:prefix, :type => :rvalue, :doc => <<-EOS This function applies a prefix to all elements in an array or a hash. *Examples:* diff --git a/lib/puppet/parser/functions/private.rb b/lib/puppet/parser/functions/private.rb index 79d1f468d..c614a1533 100644 --- a/lib/puppet/parser/functions/private.rb +++ b/lib/puppet/parser/functions/private.rb @@ -2,12 +2,12 @@ # private.rb # module Puppet::Parser::Functions - newfunction(:private, doc: <<-'EOS' + newfunction(:private, :doc => <<-'EOS' DEPRECATED: Sets the current class or definition as private. Calling the class or definition from outside the current module will fail. EOS ) do |args| - warning("private() DEPRECATED: This function will cease to function on Puppet 4; please use assert_private() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system.") # rubocop:disable Lint/LineLength : Cannot shorten this line + warning("private() DEPRECATED: This function will cease to function on Puppet 4; please use assert_private() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system.") # rubocop:disable Metrics/LineLength : Cannot shorten this line unless Puppet::Parser::Functions.autoloader.loaded?(:assert_private) Puppet::Parser::Functions.autoloader.load(:assert_private) end diff --git a/lib/puppet/parser/functions/pry.rb b/lib/puppet/parser/functions/pry.rb index 7a6b91735..4ed532e0a 100644 --- a/lib/puppet/parser/functions/pry.rb +++ b/lib/puppet/parser/functions/pry.rb @@ -2,7 +2,7 @@ # pry.rb # module Puppet::Parser::Functions - newfunction(:pry, type: :statement, doc: <<-EOS + newfunction(:pry, :type => :statement, :doc => <<-EOS This function invokes a pry debugging session in the current scope object. This is useful for debugging manifest code at specific points during a compilation. *Examples:* diff --git a/lib/puppet/parser/functions/pw_hash.rb b/lib/puppet/parser/functions/pw_hash.rb index 9fe5c07e5..eaf1d7478 100644 --- a/lib/puppet/parser/functions/pw_hash.rb +++ b/lib/puppet/parser/functions/pw_hash.rb @@ -1,9 +1,9 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. Puppet::Parser::Functions.newfunction( :pw_hash, - type: :rvalue, - arity: 3, - doc: "Hashes a password using the crypt function. Provides a hash + :type => :rvalue, + :arity => 3, + :doc => "Hashes a password using the crypt function. Provides a hash usable on most POSIX systems. The first argument to this function is the password to hash. If it is diff --git a/lib/puppet/parser/functions/range.rb b/lib/puppet/parser/functions/range.rb index ecc8592e5..489178a30 100644 --- a/lib/puppet/parser/functions/range.rb +++ b/lib/puppet/parser/functions/range.rb @@ -3,7 +3,7 @@ # # TODO(Krzysztof Wilczynski): We probably need to approach numeric values differently ... module Puppet::Parser::Functions - newfunction(:range, type: :rvalue, doc: <<-EOS + newfunction(:range, :type => :rvalue, :doc => <<-EOS When given range in the form of (start, stop) it will extrapolate a range as an array. diff --git a/lib/puppet/parser/functions/regexpescape.rb b/lib/puppet/parser/functions/regexpescape.rb index 57e2ad42b..fbdc02c6b 100644 --- a/lib/puppet/parser/functions/regexpescape.rb +++ b/lib/puppet/parser/functions/regexpescape.rb @@ -2,7 +2,7 @@ # regexpescape.rb # module Puppet::Parser::Functions - newfunction(:regexpescape, type: :rvalue, doc: <<-EOS + newfunction(:regexpescape, :type => :rvalue, :doc => <<-EOS Regexp escape a string or array of strings. Requires either a single string or an array as an input. EOS diff --git a/lib/puppet/parser/functions/reject.rb b/lib/puppet/parser/functions/reject.rb index 61b91d2d3..969a61c98 100644 --- a/lib/puppet/parser/functions/reject.rb +++ b/lib/puppet/parser/functions/reject.rb @@ -2,7 +2,7 @@ # reject.rb # module Puppet::Parser::Functions - newfunction(:reject, type: :rvalue, doc: <<-EOS) do |args| + newfunction(:reject, :type => :rvalue, :doc => <<-EOS) do |args| This function searches through an array and rejects all elements that match the provided regular expression. diff --git a/lib/puppet/parser/functions/reverse.rb b/lib/puppet/parser/functions/reverse.rb index 32e27bbe0..41184f625 100644 --- a/lib/puppet/parser/functions/reverse.rb +++ b/lib/puppet/parser/functions/reverse.rb @@ -2,7 +2,7 @@ # reverse.rb # module Puppet::Parser::Functions - newfunction(:reverse, type: :rvalue, doc: <<-EOS + newfunction(:reverse, :type => :rvalue, :doc => <<-EOS Reverses the order of a string or array. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/round.rb b/lib/puppet/parser/functions/round.rb index 2be5c60d0..8f9553ec6 100644 --- a/lib/puppet/parser/functions/round.rb +++ b/lib/puppet/parser/functions/round.rb @@ -2,7 +2,7 @@ # round.rb # module Puppet::Parser::Functions - newfunction(:round, type: :rvalue, doc: <<-EOS + newfunction(:round, :type => :rvalue, :doc => <<-EOS Rounds a number to the nearest integer *Examples:* diff --git a/lib/puppet/parser/functions/rstrip.rb b/lib/puppet/parser/functions/rstrip.rb index 0624beed6..270c8441a 100644 --- a/lib/puppet/parser/functions/rstrip.rb +++ b/lib/puppet/parser/functions/rstrip.rb @@ -2,7 +2,7 @@ # rstrip.rb # module Puppet::Parser::Functions - newfunction(:rstrip, type: :rvalue, doc: <<-EOS + newfunction(:rstrip, :type => :rvalue, :doc => <<-EOS Strips leading spaces to the right of the string. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/seeded_rand.rb b/lib/puppet/parser/functions/seeded_rand.rb index 579295857..1d283cd4e 100644 --- a/lib/puppet/parser/functions/seeded_rand.rb +++ b/lib/puppet/parser/functions/seeded_rand.rb @@ -3,9 +3,9 @@ # Puppet::Parser::Functions.newfunction( :seeded_rand, - arity: 2, - type: :rvalue, - doc: <<-EOS + :arity => 2, + :type => :rvalue, + :doc => <<-EOS Usage: `seeded_rand(MAX, SEED)`. MAX must be a positive integer; SEED is any string. Generates a random whole number greater than or equal to 0 and less diff --git a/lib/puppet/parser/functions/shell_escape.rb b/lib/puppet/parser/functions/shell_escape.rb index 91803996a..d02216100 100644 --- a/lib/puppet/parser/functions/shell_escape.rb +++ b/lib/puppet/parser/functions/shell_escape.rb @@ -3,7 +3,7 @@ # shell_escape.rb # module Puppet::Parser::Functions - newfunction(:shell_escape, type: :rvalue, doc: <<-EOS + newfunction(:shell_escape, :type => :rvalue, :doc => <<-EOS Escapes a string so that it can be safely used in a Bourne shell command line. Note that the resulting string should be used unquoted and is not intended for use in double quotes nor in single diff --git a/lib/puppet/parser/functions/shell_join.rb b/lib/puppet/parser/functions/shell_join.rb index dce92cc62..ac7011c72 100644 --- a/lib/puppet/parser/functions/shell_join.rb +++ b/lib/puppet/parser/functions/shell_join.rb @@ -4,7 +4,7 @@ # shell_join.rb # module Puppet::Parser::Functions - newfunction(:shell_join, type: :rvalue, doc: <<-EOS + newfunction(:shell_join, :type => :rvalue, :doc => <<-EOS Builds a command line string from the given array of strings. Each array item is escaped for Bourne shell. All items are then joined together, with a single space in between. diff --git a/lib/puppet/parser/functions/shell_split.rb b/lib/puppet/parser/functions/shell_split.rb index e9a3c738e..390aaeed9 100644 --- a/lib/puppet/parser/functions/shell_split.rb +++ b/lib/puppet/parser/functions/shell_split.rb @@ -3,7 +3,7 @@ # shell_split.rb # module Puppet::Parser::Functions - newfunction(:shell_split, type: :rvalue, doc: <<-EOS + newfunction(:shell_split, :type => :rvalue, :doc => <<-EOS Splits a string into an array of tokens in the same way the Bourne shell does. This function behaves the same as ruby's Shellwords.shellsplit() function diff --git a/lib/puppet/parser/functions/shuffle.rb b/lib/puppet/parser/functions/shuffle.rb index 1f280dab7..a4c59de9c 100644 --- a/lib/puppet/parser/functions/shuffle.rb +++ b/lib/puppet/parser/functions/shuffle.rb @@ -2,7 +2,7 @@ # shuffle.rb # module Puppet::Parser::Functions - newfunction(:shuffle, type: :rvalue, doc: <<-EOS + newfunction(:shuffle, :type => :rvalue, :doc => <<-EOS Randomizes the order of a string or array elements. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/size.rb b/lib/puppet/parser/functions/size.rb index 933ee27c5..547b913e3 100644 --- a/lib/puppet/parser/functions/size.rb +++ b/lib/puppet/parser/functions/size.rb @@ -2,7 +2,7 @@ # size.rb # module Puppet::Parser::Functions - newfunction(:size, type: :rvalue, doc: <<-EOS + newfunction(:size, :type => :rvalue, :doc => <<-EOS Returns the number of elements in a string, an array or a hash EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/sort.rb b/lib/puppet/parser/functions/sort.rb index 50d856b07..e28eaf36b 100644 --- a/lib/puppet/parser/functions/sort.rb +++ b/lib/puppet/parser/functions/sort.rb @@ -3,7 +3,7 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. # module Puppet::Parser::Functions - newfunction(:sort, type: :rvalue, doc: <<-EOS + newfunction(:sort, :type => :rvalue, :doc => <<-EOS Sorts strings and arrays lexically. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/squeeze.rb b/lib/puppet/parser/functions/squeeze.rb index 2ce118db9..d6a9183f9 100644 --- a/lib/puppet/parser/functions/squeeze.rb +++ b/lib/puppet/parser/functions/squeeze.rb @@ -2,7 +2,7 @@ # squeeze.rb # module Puppet::Parser::Functions - newfunction(:squeeze, type: :rvalue, doc: <<-EOS + newfunction(:squeeze, :type => :rvalue, :doc => <<-EOS Returns a new string where runs of the same character that occur in this set are replaced by a single character. EOS ) do |arguments| diff --git a/lib/puppet/parser/functions/str2bool.rb b/lib/puppet/parser/functions/str2bool.rb index 06d4c8d1d..aca521054 100644 --- a/lib/puppet/parser/functions/str2bool.rb +++ b/lib/puppet/parser/functions/str2bool.rb @@ -2,7 +2,7 @@ # str2bool.rb # module Puppet::Parser::Functions - newfunction(:str2bool, type: :rvalue, doc: <<-EOS + newfunction(:str2bool, :type => :rvalue, :doc => <<-EOS This converts a string to a boolean. This attempt to convert strings that contain things like: Y,y, 1, T,t, TRUE,true to 'true' and strings that contain things like: 0, F,f, N,n, false, FALSE, no to 'false'. diff --git a/lib/puppet/parser/functions/str2saltedsha512.rb b/lib/puppet/parser/functions/str2saltedsha512.rb index d83f11822..c53d0e33a 100644 --- a/lib/puppet/parser/functions/str2saltedsha512.rb +++ b/lib/puppet/parser/functions/str2saltedsha512.rb @@ -3,7 +3,7 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. # module Puppet::Parser::Functions - newfunction(:str2saltedsha512, type: :rvalue, doc: <<-EOS + newfunction(:str2saltedsha512, :type => :rvalue, :doc => <<-EOS This converts a string to a salted-SHA512 password hash (which is used for OS X versions >= 10.7). Given any simple string, you will get a hex version of a salted-SHA512 password hash that can be inserted into your Puppet diff --git a/lib/puppet/parser/functions/strftime.rb b/lib/puppet/parser/functions/strftime.rb index 8429a9527..36902f120 100644 --- a/lib/puppet/parser/functions/strftime.rb +++ b/lib/puppet/parser/functions/strftime.rb @@ -3,7 +3,7 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. # module Puppet::Parser::Functions - newfunction(:strftime, type: :rvalue, doc: <<-EOS + newfunction(:strftime, :type => :rvalue, :doc => <<-EOS This function returns formatted time. *Examples:* diff --git a/lib/puppet/parser/functions/strip.rb b/lib/puppet/parser/functions/strip.rb index 59ee166f3..fbd28e788 100644 --- a/lib/puppet/parser/functions/strip.rb +++ b/lib/puppet/parser/functions/strip.rb @@ -2,7 +2,7 @@ # strip.rb # module Puppet::Parser::Functions - newfunction(:strip, type: :rvalue, doc: <<-EOS + newfunction(:strip, :type => :rvalue, :doc => <<-EOS This function removes leading and trailing whitespace from a string or from every string inside an array. diff --git a/lib/puppet/parser/functions/suffix.rb b/lib/puppet/parser/functions/suffix.rb index 3dc86afce..067113c6d 100644 --- a/lib/puppet/parser/functions/suffix.rb +++ b/lib/puppet/parser/functions/suffix.rb @@ -2,7 +2,7 @@ # suffix.rb # module Puppet::Parser::Functions - newfunction(:suffix, type: :rvalue, doc: <<-EOS + newfunction(:suffix, :type => :rvalue, :doc => <<-EOS This function applies a suffix to all elements in an array, or to the keys in a hash. diff --git a/lib/puppet/parser/functions/swapcase.rb b/lib/puppet/parser/functions/swapcase.rb index 4da9ec0c1..a004e0904 100644 --- a/lib/puppet/parser/functions/swapcase.rb +++ b/lib/puppet/parser/functions/swapcase.rb @@ -3,7 +3,7 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. # module Puppet::Parser::Functions - newfunction(:swapcase, type: :rvalue, doc: <<-EOS + newfunction(:swapcase, :type => :rvalue, :doc => <<-EOS This function will swap the existing case of a string. *Examples:* diff --git a/lib/puppet/parser/functions/time.rb b/lib/puppet/parser/functions/time.rb index cf7e29c04..4239785bb 100644 --- a/lib/puppet/parser/functions/time.rb +++ b/lib/puppet/parser/functions/time.rb @@ -2,7 +2,7 @@ # time.rb # module Puppet::Parser::Functions - newfunction(:time, type: :rvalue, doc: <<-EOS + newfunction(:time, :type => :rvalue, :doc => <<-EOS This function will return the current time since epoch as an integer. *Examples:* diff --git a/lib/puppet/parser/functions/to_bytes.rb b/lib/puppet/parser/functions/to_bytes.rb index be735504c..18d0edbb0 100644 --- a/lib/puppet/parser/functions/to_bytes.rb +++ b/lib/puppet/parser/functions/to_bytes.rb @@ -2,7 +2,7 @@ # to_bytes.rb # module Puppet::Parser::Functions - newfunction(:to_bytes, type: :rvalue, doc: <<-EOS + newfunction(:to_bytes, :type => :rvalue, :doc => <<-EOS Converts the argument into bytes, for example 4 kB becomes 4096. Takes a single string value as an argument. These conversions reflect a layperson's understanding of diff --git a/lib/puppet/parser/functions/try_get_value.rb b/lib/puppet/parser/functions/try_get_value.rb index 989d57650..e722390e6 100644 --- a/lib/puppet/parser/functions/try_get_value.rb +++ b/lib/puppet/parser/functions/try_get_value.rb @@ -4,9 +4,9 @@ module Puppet::Parser::Functions newfunction( :try_get_value, - type: :rvalue, - arity: -2, - doc: <<-eos + :type => :rvalue, + :arity => -2, + :doc => <<-eos DEPRECATED: this function is deprecated, please use dig() instead. Looks up into a complex structure of arrays and hashes and returns a value diff --git a/lib/puppet/parser/functions/type.rb b/lib/puppet/parser/functions/type.rb index bb197a07c..e43c44e03 100644 --- a/lib/puppet/parser/functions/type.rb +++ b/lib/puppet/parser/functions/type.rb @@ -2,7 +2,7 @@ # type.rb # module Puppet::Parser::Functions - newfunction(:type, type: :rvalue, doc: <<-EOS + newfunction(:type, :type => :rvalue, :doc => <<-EOS DEPRECATED: This function will cease to function on Puppet 4; please use type3x() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system. EOS ) do |args| diff --git a/lib/puppet/parser/functions/type3x.rb b/lib/puppet/parser/functions/type3x.rb index ae794ded5..f78df4cd9 100644 --- a/lib/puppet/parser/functions/type3x.rb +++ b/lib/puppet/parser/functions/type3x.rb @@ -2,7 +2,7 @@ # type3x.rb # module Puppet::Parser::Functions - newfunction(:type3x, type: :rvalue, doc: <<-EOS + newfunction(:type3x, :type => :rvalue, :doc => <<-EOS DEPRECATED: This function will be removed when puppet 3 support is dropped; please migrate to the new parser's typing system. Returns the type when passed a value. Type can be one of: diff --git a/lib/puppet/parser/functions/union.rb b/lib/puppet/parser/functions/union.rb index 2543408e2..033502fa6 100644 --- a/lib/puppet/parser/functions/union.rb +++ b/lib/puppet/parser/functions/union.rb @@ -2,7 +2,7 @@ # union.rb # module Puppet::Parser::Functions - newfunction(:union, type: :rvalue, doc: <<-EOS + newfunction(:union, :type => :rvalue, :doc => <<-EOS This function returns a union of two or more arrays. *Examples:* diff --git a/lib/puppet/parser/functions/unique.rb b/lib/puppet/parser/functions/unique.rb index b7c627f48..2a1939be4 100644 --- a/lib/puppet/parser/functions/unique.rb +++ b/lib/puppet/parser/functions/unique.rb @@ -2,7 +2,7 @@ # unique.rb # module Puppet::Parser::Functions - newfunction(:unique, type: :rvalue, doc: <<-EOS + newfunction(:unique, :type => :rvalue, :doc => <<-EOS This function will remove duplicates from strings and arrays. *Examples:* diff --git a/lib/puppet/parser/functions/unix2dos.rb b/lib/puppet/parser/functions/unix2dos.rb index 719c6d936..ccfc45dbe 100644 --- a/lib/puppet/parser/functions/unix2dos.rb +++ b/lib/puppet/parser/functions/unix2dos.rb @@ -1,6 +1,6 @@ # Custom Puppet function to convert unix to dos format module Puppet::Parser::Functions - newfunction(:unix2dos, type: :rvalue, arity: 1, doc: <<-EOS + newfunction(:unix2dos, :type => :rvalue, :arity => 1, :doc => <<-EOS Returns the DOS version of the given string. Takes a single string argument. EOS diff --git a/lib/puppet/parser/functions/upcase.rb b/lib/puppet/parser/functions/upcase.rb index 033b5731d..9e04cdc4c 100644 --- a/lib/puppet/parser/functions/upcase.rb +++ b/lib/puppet/parser/functions/upcase.rb @@ -3,7 +3,7 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. # module Puppet::Parser::Functions - newfunction(:upcase, type: :rvalue, doc: <<-EOS + newfunction(:upcase, :type => :rvalue, :doc => <<-EOS Converts a string or an array of strings to uppercase. *Examples:* diff --git a/lib/puppet/parser/functions/uriescape.rb b/lib/puppet/parser/functions/uriescape.rb index 726f7f99a..6b44b3724 100644 --- a/lib/puppet/parser/functions/uriescape.rb +++ b/lib/puppet/parser/functions/uriescape.rb @@ -4,7 +4,7 @@ # Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085. # module Puppet::Parser::Functions - newfunction(:uriescape, type: :rvalue, doc: <<-EOS + newfunction(:uriescape, :type => :rvalue, :doc => <<-EOS Urlencodes a string or array of strings. Requires either a single string or an array as an input. EOS diff --git a/lib/puppet/parser/functions/validate_absolute_path.rb b/lib/puppet/parser/functions/validate_absolute_path.rb index 212bbacd0..16de3d020 100644 --- a/lib/puppet/parser/functions/validate_absolute_path.rb +++ b/lib/puppet/parser/functions/validate_absolute_path.rb @@ -2,7 +2,7 @@ # validate_absolute_path.rb # module Puppet::Parser::Functions - newfunction(:validate_absolute_path, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_absolute_path, :doc => <<-'ENDHEREDOC') do |args| Validate the string represents an absolute path in the filesystem. This function works for windows and unix style paths. diff --git a/lib/puppet/parser/functions/validate_array.rb b/lib/puppet/parser/functions/validate_array.rb index 9ae58a6ea..eb82cdb7f 100644 --- a/lib/puppet/parser/functions/validate_array.rb +++ b/lib/puppet/parser/functions/validate_array.rb @@ -2,7 +2,7 @@ # validate_array.rb # module Puppet::Parser::Functions - newfunction(:validate_array, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_array, :doc => <<-'ENDHEREDOC') do |args| Validate that all passed values are array data structures. Abort catalog compilation if any value fails this check. diff --git a/lib/puppet/parser/functions/validate_augeas.rb b/lib/puppet/parser/functions/validate_augeas.rb index 5be54e8f1..4b5ab063c 100644 --- a/lib/puppet/parser/functions/validate_augeas.rb +++ b/lib/puppet/parser/functions/validate_augeas.rb @@ -4,7 +4,7 @@ # validate_augaes.rb # module Puppet::Parser::Functions - newfunction(:validate_augeas, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_augeas, :doc => <<-'ENDHEREDOC') do |args| Perform validation of a string using an Augeas lens The first argument of this function should be a string to test, and the second argument should be the name of the Augeas lens to use. @@ -59,9 +59,9 @@ module Puppet::Parser::Functions # Check for syntax lens = args[1] aug.transform( - lens: lens, - name: 'Validate_augeas', - incl: tmpfile.path, + :lens => lens, + :name => 'Validate_augeas', + :incl => tmpfile.path, ) aug.load! diff --git a/lib/puppet/parser/functions/validate_bool.rb b/lib/puppet/parser/functions/validate_bool.rb index 97852c6ca..7e269336a 100644 --- a/lib/puppet/parser/functions/validate_bool.rb +++ b/lib/puppet/parser/functions/validate_bool.rb @@ -2,7 +2,7 @@ # validate_bool.rb # module Puppet::Parser::Functions - newfunction(:validate_bool, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_bool, :doc => <<-'ENDHEREDOC') do |args| Validate that all passed values are either true or false. Abort catalog compilation if any value fails this check. diff --git a/lib/puppet/parser/functions/validate_cmd.rb b/lib/puppet/parser/functions/validate_cmd.rb index 49eec5a96..9e74a3d46 100644 --- a/lib/puppet/parser/functions/validate_cmd.rb +++ b/lib/puppet/parser/functions/validate_cmd.rb @@ -5,7 +5,7 @@ # validate_cmd.rb # module Puppet::Parser::Functions - newfunction(:validate_cmd, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_cmd, :doc => <<-'ENDHEREDOC') do |args| Perform validation of a string with an external command. The first argument of this function should be a string to test, and the second argument should be a path to a test command diff --git a/lib/puppet/parser/functions/validate_domain_name.rb b/lib/puppet/parser/functions/validate_domain_name.rb index dd6b8e86a..58c9d3a80 100644 --- a/lib/puppet/parser/functions/validate_domain_name.rb +++ b/lib/puppet/parser/functions/validate_domain_name.rb @@ -2,7 +2,7 @@ # validate_domain_name.rb # module Puppet::Parser::Functions - newfunction(:validate_domain_name, doc: <<-ENDHEREDOC + newfunction(:validate_domain_name, :doc => <<-ENDHEREDOC Validate that all values passed are syntactically correct domain names. Fail compilation if any value fails this check. diff --git a/lib/puppet/parser/functions/validate_email_address.rb b/lib/puppet/parser/functions/validate_email_address.rb index f9765adf0..779710005 100644 --- a/lib/puppet/parser/functions/validate_email_address.rb +++ b/lib/puppet/parser/functions/validate_email_address.rb @@ -2,7 +2,7 @@ # validate_email_address.rb # module Puppet::Parser::Functions - newfunction(:validate_email_address, doc: <<-ENDHEREDOC + newfunction(:validate_email_address, :doc => <<-ENDHEREDOC Validate that all values passed are valid email addresses. Fail compilation if any value fails this check. The following values will pass: diff --git a/lib/puppet/parser/functions/validate_hash.rb b/lib/puppet/parser/functions/validate_hash.rb index 3ecaad121..14685d7bc 100644 --- a/lib/puppet/parser/functions/validate_hash.rb +++ b/lib/puppet/parser/functions/validate_hash.rb @@ -2,7 +2,7 @@ # validate_hash.rb # module Puppet::Parser::Functions - newfunction(:validate_hash, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_hash, :doc => <<-'ENDHEREDOC') do |args| Validate that all passed values are hash data structures. Abort catalog compilation if any value fails this check. diff --git a/lib/puppet/parser/functions/validate_integer.rb b/lib/puppet/parser/functions/validate_integer.rb index d0d23ede3..93d8cc554 100644 --- a/lib/puppet/parser/functions/validate_integer.rb +++ b/lib/puppet/parser/functions/validate_integer.rb @@ -2,7 +2,7 @@ # validate_interger.rb # module Puppet::Parser::Functions - newfunction(:validate_integer, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_integer, :doc => <<-'ENDHEREDOC') do |args| Validate that the first argument is an integer (or an array of integers). Abort catalog compilation if any of the checks fail. The second argument is optional and passes a maximum. (All elements of) the first argument has to be less or equal to this max. diff --git a/lib/puppet/parser/functions/validate_ip_address.rb b/lib/puppet/parser/functions/validate_ip_address.rb index 2657da2f6..dba0d9659 100644 --- a/lib/puppet/parser/functions/validate_ip_address.rb +++ b/lib/puppet/parser/functions/validate_ip_address.rb @@ -2,7 +2,7 @@ # validate_ip_address.rb # module Puppet::Parser::Functions - newfunction(:validate_ip_address, doc: <<-ENDHEREDOC + newfunction(:validate_ip_address, :doc => <<-ENDHEREDOC Validate that all values passed are valid IP addresses, regardless they are IPv4 or IPv6 Fail compilation if any value fails this check. diff --git a/lib/puppet/parser/functions/validate_ipv4_address.rb b/lib/puppet/parser/functions/validate_ipv4_address.rb index e8651b51f..9da53e7fd 100644 --- a/lib/puppet/parser/functions/validate_ipv4_address.rb +++ b/lib/puppet/parser/functions/validate_ipv4_address.rb @@ -2,7 +2,7 @@ # validate_ipv4_address.rb # module Puppet::Parser::Functions - newfunction(:validate_ipv4_address, doc: <<-ENDHEREDOC + newfunction(:validate_ipv4_address, :doc => <<-ENDHEREDOC Validate that all values passed are valid IPv4 addresses. Fail compilation if any value fails this check. diff --git a/lib/puppet/parser/functions/validate_ipv6_address.rb b/lib/puppet/parser/functions/validate_ipv6_address.rb index 8a0c3d342..611b546ba 100644 --- a/lib/puppet/parser/functions/validate_ipv6_address.rb +++ b/lib/puppet/parser/functions/validate_ipv6_address.rb @@ -2,7 +2,7 @@ # validate_ipv7_address.rb # module Puppet::Parser::Functions - newfunction(:validate_ipv6_address, doc: <<-ENDHEREDOC + newfunction(:validate_ipv6_address, :doc => <<-ENDHEREDOC Validate that all values passed are valid IPv6 addresses. Fail compilation if any value fails this check. diff --git a/lib/puppet/parser/functions/validate_numeric.rb b/lib/puppet/parser/functions/validate_numeric.rb index a87083f33..72069094f 100644 --- a/lib/puppet/parser/functions/validate_numeric.rb +++ b/lib/puppet/parser/functions/validate_numeric.rb @@ -2,7 +2,7 @@ # validate_numeric.rb # module Puppet::Parser::Functions - newfunction(:validate_numeric, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_numeric, :doc => <<-'ENDHEREDOC') do |args| Validate that the first argument is a numeric value (or an array of numeric values). Abort catalog compilation if any of the checks fail. The second argument is optional and passes a maximum. (All elements of) the first argument has to be less or equal to this max. diff --git a/lib/puppet/parser/functions/validate_re.rb b/lib/puppet/parser/functions/validate_re.rb index d3578aa24..1fb59ef36 100644 --- a/lib/puppet/parser/functions/validate_re.rb +++ b/lib/puppet/parser/functions/validate_re.rb @@ -2,7 +2,7 @@ # validate.rb # module Puppet::Parser::Functions - newfunction(:validate_re, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_re, :doc => <<-'ENDHEREDOC') do |args| Perform simple validation of a string against one or more regular expressions. The first argument of this function should be a string to test, and the second argument should be a stringified regular expression diff --git a/lib/puppet/parser/functions/validate_slength.rb b/lib/puppet/parser/functions/validate_slength.rb index df5bab30b..92573eb5e 100644 --- a/lib/puppet/parser/functions/validate_slength.rb +++ b/lib/puppet/parser/functions/validate_slength.rb @@ -2,7 +2,7 @@ # validate_slength.rb # module Puppet::Parser::Functions - newfunction(:validate_slength, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_slength, :doc => <<-'ENDHEREDOC') do |args| Validate that the first argument is a string (or an array of strings), and less/equal to than the length of the second argument. An optional third parameter can be given the minimum length. It fails if the first diff --git a/lib/puppet/parser/functions/validate_string.rb b/lib/puppet/parser/functions/validate_string.rb index bef21423b..c15049969 100644 --- a/lib/puppet/parser/functions/validate_string.rb +++ b/lib/puppet/parser/functions/validate_string.rb @@ -2,7 +2,7 @@ # validate_String.rb # module Puppet::Parser::Functions - newfunction(:validate_string, doc: <<-'ENDHEREDOC') do |args| + newfunction(:validate_string, :doc => <<-'ENDHEREDOC') do |args| Validate that all passed values are string data structures. Abort catalog compilation if any value fails this check. diff --git a/lib/puppet/parser/functions/validate_x509_rsa_key_pair.rb b/lib/puppet/parser/functions/validate_x509_rsa_key_pair.rb index 557e3a623..2dcc48e91 100644 --- a/lib/puppet/parser/functions/validate_x509_rsa_key_pair.rb +++ b/lib/puppet/parser/functions/validate_x509_rsa_key_pair.rb @@ -2,7 +2,7 @@ # validate_x509_rsa_key_pair.rb # module Puppet::Parser::Functions - newfunction(:validate_x509_rsa_key_pair, doc: <<-ENDHEREDOC + newfunction(:validate_x509_rsa_key_pair, :doc => <<-ENDHEREDOC Validates a PEM-formatted X.509 certificate and RSA private key using OpenSSL. Verifies that the certficate's signature was created from the supplied key. diff --git a/lib/puppet/parser/functions/values.rb b/lib/puppet/parser/functions/values.rb index 01c448b5c..4290e56dc 100644 --- a/lib/puppet/parser/functions/values.rb +++ b/lib/puppet/parser/functions/values.rb @@ -2,7 +2,7 @@ # values.rb # module Puppet::Parser::Functions - newfunction(:values, type: :rvalue, doc: <<-EOS + newfunction(:values, :type => :rvalue, :doc => <<-EOS When given a hash this function will return the values of that hash. *Examples:* diff --git a/lib/puppet/parser/functions/values_at.rb b/lib/puppet/parser/functions/values_at.rb index dd9a040d6..0016551ee 100644 --- a/lib/puppet/parser/functions/values_at.rb +++ b/lib/puppet/parser/functions/values_at.rb @@ -2,7 +2,7 @@ # values_at.rb # module Puppet::Parser::Functions - newfunction(:values_at, type: :rvalue, doc: <<-EOS + newfunction(:values_at, :type => :rvalue, :doc => <<-EOS Finds value inside an array based on location. The first argument is the array you want to analyze, and the second element can diff --git a/lib/puppet/parser/functions/zip.rb b/lib/puppet/parser/functions/zip.rb index d183b3c15..3e731c5b7 100644 --- a/lib/puppet/parser/functions/zip.rb +++ b/lib/puppet/parser/functions/zip.rb @@ -2,7 +2,7 @@ # zip.rb # module Puppet::Parser::Functions - newfunction(:zip, type: :rvalue, doc: <<-EOS + newfunction(:zip, :type => :rvalue, :doc => <<-EOS Takes one element from first array and merges corresponding elements from second array. This generates a sequence of n-element arrays, where n is one more than the count of arguments. *Example:* diff --git a/lib/puppet/provider/file_line/ruby.rb b/lib/puppet/provider/file_line/ruby.rb index 6e95b9e97..a42f5809c 100644 --- a/lib/puppet/provider/file_line/ruby.rb +++ b/lib/puppet/provider/file_line/ruby.rb @@ -76,7 +76,7 @@ def lines # small-ish config files that can fit into memory without # too much trouble. - @lines ||= File.readlines(resource[:path], encoding: resource[:encoding]) + @lines ||= File.readlines(resource[:path], :encoding => resource[:encoding]) rescue TypeError => _e # Ruby 1.8 doesn't support open_args @lines ||= File.readlines(resource[:path]) diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb index 377f4d556..274bb2947 100644 --- a/lib/puppet/type/file_line.rb +++ b/lib/puppet/type/file_line.rb @@ -92,7 +92,7 @@ defaultto :present end - newparam(:name, namevar: true) do + newparam(:name, :namevar => true) do desc 'An arbitrary name used as the identity of the resource.' end diff --git a/spec/acceptance/abs_spec.rb b/spec/acceptance/abs_spec.rb index a7df2cbd1..b4cc09e06 100755 --- a/spec/acceptance/abs_spec.rb +++ b/spec/acceptance/abs_spec.rb @@ -9,7 +9,7 @@ notify { "$output": } EOS it 'accepts a string' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: 34.56}) end end @@ -20,7 +20,7 @@ notify { "$output": } EOS it 'accepts a float' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: 35.46}) end end diff --git a/spec/acceptance/anchor_spec.rb b/spec/acceptance/anchor_spec.rb index d558dde61..2f4c269de 100755 --- a/spec/acceptance/anchor_spec.rb +++ b/spec/acceptance/anchor_spec.rb @@ -17,7 +17,7 @@ class anchorrefresh { include anchorrefresh EOS it 'effects proper chaining of resources' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Anchor\[final\]: Triggered 'refresh'}) end end diff --git a/spec/acceptance/any2array_spec.rb b/spec/acceptance/any2array_spec.rb index a7d18fad1..23b10ba96 100755 --- a/spec/acceptance/any2array_spec.rb +++ b/spec/acceptance/any2array_spec.rb @@ -10,7 +10,7 @@ notify { "Output: ${output}": } EOS it 'creates an empty array' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: Output: }) end end @@ -22,7 +22,7 @@ notify { "Output: ${output}": } EOS it 'leaves arrays modified' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: Output: (\[|)array(,\s|)test(\]|)}) end end @@ -38,7 +38,7 @@ notify { "Output: ${output}": } EOS it 'turns a hash into an array' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: Output: (\[|)test(,\s|)array(\]|)}) end end diff --git a/spec/acceptance/base64_spec.rb b/spec/acceptance/base64_spec.rb index 537165512..7b31dde7f 100755 --- a/spec/acceptance/base64_spec.rb +++ b/spec/acceptance/base64_spec.rb @@ -9,7 +9,7 @@ notify { $decodestring: } EOS it 'encodes then decode a string' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{thestring}) end end diff --git a/spec/acceptance/bool2num_spec.rb b/spec/acceptance/bool2num_spec.rb index 0665b166b..239aabd97 100755 --- a/spec/acceptance/bool2num_spec.rb +++ b/spec/acceptance/bool2num_spec.rb @@ -10,7 +10,7 @@ notify { "$output": } EOS it "should convert a given boolean, #{bool}, to 0" do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: 0}) end end @@ -23,7 +23,7 @@ notify { "$output": } EOS it "should convert a given boolean, #{bool}, to 1" do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: 1}) end end diff --git a/spec/acceptance/capitalize_spec.rb b/spec/acceptance/capitalize_spec.rb index 11d40b70e..17b37aafc 100755 --- a/spec/acceptance/capitalize_spec.rb +++ b/spec/acceptance/capitalize_spec.rb @@ -9,7 +9,7 @@ notify { $output: } EOS it 'capitalizes the first letter of a string' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: This is a string}) end end @@ -21,7 +21,7 @@ EOS regex_array = [%r{Notice: This}, %r{Notice: Is}, %r{Notice: A}, %r{Notice: String}] it 'capitalizes the first letter of an array of strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| regex_array.each do |i| expect(r.stdout).to match(i) end diff --git a/spec/acceptance/ceiling_spec.rb b/spec/acceptance/ceiling_spec.rb index 34ef04b35..6d9e10e5f 100755 --- a/spec/acceptance/ceiling_spec.rb +++ b/spec/acceptance/ceiling_spec.rb @@ -12,7 +12,7 @@ } EOS it 'ceilings floats' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'ceilings integers' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output is correct}) end end diff --git a/spec/acceptance/chomp_spec.rb b/spec/acceptance/chomp_spec.rb index bdfd47e54..7d2a91b8c 100755 --- a/spec/acceptance/chomp_spec.rb +++ b/spec/acceptance/chomp_spec.rb @@ -14,7 +14,7 @@ } EOS it 'eats the newline' do - apply_manifest(pp, catch_failures: true) + apply_manifest(pp, :catch_failures => true) end end end diff --git a/spec/acceptance/chop_spec.rb b/spec/acceptance/chop_spec.rb index a75315e5d..535b8010c 100755 --- a/spec/acceptance/chop_spec.rb +++ b/spec/acceptance/chop_spec.rb @@ -14,7 +14,7 @@ } EOS it 'eats the last character' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-'EOS' @@ -28,7 +28,7 @@ } EOS it 'eats the last two characters of \r\n' do - apply_manifest(pp2, catch_failures: true) + apply_manifest(pp2, :catch_failures => true) end pp3 = <<-EOS @@ -36,7 +36,7 @@ $output = chop($input) EOS it 'does not fail on empty strings' do - apply_manifest(pp3, catch_failures: true) + apply_manifest(pp3, :catch_failures => true) end end end diff --git a/spec/acceptance/clamp_spec.rb b/spec/acceptance/clamp_spec.rb index 1f5038b7d..da5860ac2 100755 --- a/spec/acceptance/clamp_spec.rb +++ b/spec/acceptance/clamp_spec.rb @@ -13,7 +13,7 @@ } EOS it 'clamps list of values' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -27,7 +27,7 @@ } EOS it 'clamps array of values' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/concat_spec.rb b/spec/acceptance/concat_spec.rb index a65f77890..8cecd4d8c 100755 --- a/spec/acceptance/concat_spec.rb +++ b/spec/acceptance/concat_spec.rb @@ -11,7 +11,7 @@ } EOS it 'concats one array to another' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-EOS @@ -22,7 +22,7 @@ } EOS it 'concats arrays and primitives to array' do - apply_manifest(pp2, catch_failures: true) + apply_manifest(pp2, :catch_failures => true) end pp3 = <<-EOS @@ -33,7 +33,7 @@ } EOS it 'concats multiple arrays to one' do - apply_manifest(pp3, catch_failures: true) + apply_manifest(pp3, :catch_failures => true) end pp4 = <<-EOS @@ -47,7 +47,7 @@ } EOS it 'concats hash arguments' do - apply_manifest(pp4, catch_failures: true) + apply_manifest(pp4, :catch_failures => true) end end end diff --git a/spec/acceptance/count_spec.rb b/spec/acceptance/count_spec.rb index 280546291..a7f780d45 100755 --- a/spec/acceptance/count_spec.rb +++ b/spec/acceptance/count_spec.rb @@ -9,7 +9,7 @@ notify { "$output": } EOS it 'counts elements in an array' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: 4}) end end @@ -20,7 +20,7 @@ notify { "$output": } EOS it 'counts elements in an array that match a second argument' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: 3}) end end diff --git a/spec/acceptance/deep_merge_spec.rb b/spec/acceptance/deep_merge_spec.rb index 93edc3b2f..060366c9e 100755 --- a/spec/acceptance/deep_merge_spec.rb +++ b/spec/acceptance/deep_merge_spec.rb @@ -13,7 +13,7 @@ } EOS it 'deeps merge two hashes' do - apply_manifest(pp, catch_failures: true) + apply_manifest(pp, :catch_failures => true) end end end diff --git a/spec/acceptance/defined_with_params_spec.rb b/spec/acceptance/defined_with_params_spec.rb index 809c48576..0a27702ec 100755 --- a/spec/acceptance/defined_with_params_spec.rb +++ b/spec/acceptance/defined_with_params_spec.rb @@ -13,7 +13,7 @@ } EOS it 'successfullies notify' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: User defined with ensure=>present}) end end diff --git a/spec/acceptance/delete_at_spec.rb b/spec/acceptance/delete_at_spec.rb index dbd39b48a..7bcc9f8a6 100755 --- a/spec/acceptance/delete_at_spec.rb +++ b/spec/acceptance/delete_at_spec.rb @@ -10,7 +10,7 @@ } EOS it 'deletes elements of the array' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/delete_spec.rb b/spec/acceptance/delete_spec.rb index da9f1cf68..b349f6148 100755 --- a/spec/acceptance/delete_spec.rb +++ b/spec/acceptance/delete_spec.rb @@ -10,7 +10,7 @@ EOS describe 'success' do it 'deletes elements of the array' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/delete_undef_values_spec.rb b/spec/acceptance/delete_undef_values_spec.rb index d07fdede8..411905c77 100755 --- a/spec/acceptance/delete_undef_values_spec.rb +++ b/spec/acceptance/delete_undef_values_spec.rb @@ -10,7 +10,7 @@ } EOS it 'deletes elements of the array' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/delete_values_spec.rb b/spec/acceptance/delete_values_spec.rb index 23279bfa1..bc8827a94 100755 --- a/spec/acceptance/delete_values_spec.rb +++ b/spec/acceptance/delete_values_spec.rb @@ -12,7 +12,7 @@ } EOS it 'deletes elements of the hash' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/deprecation_spec.rb b/spec/acceptance/deprecation_spec.rb index 3c53b68c2..6ad97db95 100644 --- a/spec/acceptance/deprecation_spec.rb +++ b/spec/acceptance/deprecation_spec.rb @@ -16,8 +16,8 @@ apply_manifest(remove_file_manifest) end - context 'with --strict=error', if: return_puppet_version =~ %r{^4} do - let(:result) { on(default, puppet('apply', '--strict=error', '-e', add_file_manifest), acceptable_exit_codes: (0...256)) } + context 'with --strict=error', :if => return_puppet_version =~ %r{^4} do + let(:result) { on(default, puppet('apply', '--strict=error', '-e', add_file_manifest), :acceptable_exit_codes => (0...256)) } after :all do apply_manifest(remove_file_manifest) @@ -36,8 +36,8 @@ end end - context 'with --strict=warning', if: return_puppet_version =~ %r{^4} do - let(:result) { on(default, puppet('apply', '--strict=warning', '-e', add_file_manifest), acceptable_exit_codes: (0...256)) } + context 'with --strict=warning', :if => return_puppet_version =~ %r{^4} do + let(:result) { on(default, puppet('apply', '--strict=warning', '-e', add_file_manifest), :acceptable_exit_codes => (0...256)) } after :all do apply_manifest(remove_file_manifest) @@ -56,8 +56,8 @@ end end - context 'with --strict=off', if: return_puppet_version =~ %r{^4} do - let(:result) { on(default, puppet('apply', '--strict=off', '-e', add_file_manifest), acceptable_exit_codes: (0...256)) } + context 'with --strict=off', :if => return_puppet_version =~ %r{^4} do + let(:result) { on(default, puppet('apply', '--strict=off', '-e', add_file_manifest), :acceptable_exit_codes => (0...256)) } after :all do apply_manifest(remove_file_manifest) @@ -76,8 +76,8 @@ end end - context 'puppet 3 test', if: return_puppet_version =~ %r{^3} do - let(:result) { on(default, puppet('apply', '--parser=future', '-e', add_file_manifest), acceptable_exit_codes: (0...256)) } + context 'puppet 3 test', :if => return_puppet_version =~ %r{^3} do + let(:result) { on(default, puppet('apply', '--parser=future', '-e', add_file_manifest), :acceptable_exit_codes => (0...256)) } after :all do apply_manifest(remove_file_manifest) diff --git a/spec/acceptance/difference_spec.rb b/spec/acceptance/difference_spec.rb index b0c131cf4..a45f6ab74 100755 --- a/spec/acceptance/difference_spec.rb +++ b/spec/acceptance/difference_spec.rb @@ -13,7 +13,7 @@ } EOS it 'returns non-duplicates in the first array' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/dirname_spec.rb b/spec/acceptance/dirname_spec.rb index 0cd26a24e..1e00c5887 100755 --- a/spec/acceptance/dirname_spec.rb +++ b/spec/acceptance/dirname_spec.rb @@ -13,7 +13,7 @@ } EOS it 'returns the dirname' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -28,7 +28,7 @@ } EOS it 'returns the dirname' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/downcase_spec.rb b/spec/acceptance/downcase_spec.rb index 297c7845c..c3d537bb1 100755 --- a/spec/acceptance/downcase_spec.rb +++ b/spec/acceptance/downcase_spec.rb @@ -12,7 +12,7 @@ } EOS it 'returns the downcase' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'doesn\'t affect lowercase words' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/empty_spec.rb b/spec/acceptance/empty_spec.rb index 902f8db43..3201ba83b 100755 --- a/spec/acceptance/empty_spec.rb +++ b/spec/acceptance/empty_spec.rb @@ -12,7 +12,7 @@ } EOS it 'recognizes empty strings' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'recognizes non-empty strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -40,7 +40,7 @@ } EOS it 'handles numerical values' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/ensure_resource_spec.rb b/spec/acceptance/ensure_resource_spec.rb index cc751ba48..3b0807192 100755 --- a/spec/acceptance/ensure_resource_spec.rb +++ b/spec/acceptance/ensure_resource_spec.rb @@ -10,7 +10,7 @@ it 'ensures a resource already declared' do apply_manifest('') - apply_manifest(pp1, expect_changes: true) + apply_manifest(pp1, :expect_changes => true) end pp2 = <<-EOS @@ -19,7 +19,7 @@ it 'ensures a undeclared resource' do apply_manifest('') - apply_manifest(pp2, expect_changes: true) + apply_manifest(pp2, :expect_changes => true) end it 'takes defaults arguments' end diff --git a/spec/acceptance/flatten_spec.rb b/spec/acceptance/flatten_spec.rb index 95637902b..cf1a43a39 100755 --- a/spec/acceptance/flatten_spec.rb +++ b/spec/acceptance/flatten_spec.rb @@ -12,7 +12,7 @@ } EOS it 'flattens arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'does not affect flat arrays' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/floor_spec.rb b/spec/acceptance/floor_spec.rb index 628045dec..efe777342 100755 --- a/spec/acceptance/floor_spec.rb +++ b/spec/acceptance/floor_spec.rb @@ -12,7 +12,7 @@ } EOS it 'floors floats' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'floors integers' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/fqdn_rand_string_spec.rb b/spec/acceptance/fqdn_rand_string_spec.rb index 7f265a07b..a1380093c 100644 --- a/spec/acceptance/fqdn_rand_string_spec.rb +++ b/spec/acceptance/fqdn_rand_string_spec.rb @@ -15,7 +15,7 @@ notice(inline_template('fqdn_rand_string is <%= @o.inspect %>')) eos it 'generates random alphanumeric strings' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{fqdn_rand_string is "(7oDp0KOr1b|9Acvnhkt4J)"}) end end @@ -27,7 +27,7 @@ notice(inline_template('fqdn_rand_string is <%= @o.inspect %>')) eos it 'generates random alphanumeric strings with custom charsets' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{fqdn_rand_string is "(7203048515|2383756694)"}) end end @@ -39,7 +39,7 @@ notice(inline_template('fqdn_rand_string is <%= @o.inspect %>')) eos it 'generates random alphanumeric strings with custom seeds' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{fqdn_rand_string is "(3HS4mbuI3E|1jJtAMs94d)"}) end end @@ -52,7 +52,7 @@ notice(inline_template('fqdn_rand_string is <%= @o.inspect %>')) eos it 'generates random alphanumeric strings with custom charsets and seeds' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{fqdn_rand_string is "(3104058232|7100592312)"}) end end diff --git a/spec/acceptance/fqdn_rotate_spec.rb b/spec/acceptance/fqdn_rotate_spec.rb index ec1b43f44..613ab2ab0 100755 --- a/spec/acceptance/fqdn_rotate_spec.rb +++ b/spec/acceptance/fqdn_rotate_spec.rb @@ -15,7 +15,7 @@ notice(inline_template('fqdn_rotate is <%= @o.inspect %>')) EOS it 'rotates arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{fqdn_rotate is \["d", "a", "b", "c"\]}) end end @@ -27,7 +27,7 @@ notice(inline_template('fqdn_rotate is <%= @o.inspect %>')) EOS it 'rotates arrays with custom seeds' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{fqdn_rotate is \["c", "d", "a", "b"\]}) end end @@ -38,7 +38,7 @@ notice(inline_template('fqdn_rotate is <%= @o.inspect %>')) EOS it 'rotates strings' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{fqdn_rotate is "dabc"}) end end @@ -50,7 +50,7 @@ notice(inline_template('fqdn_rotate is <%= @o.inspect %>')) EOS it 'rotates strings with custom seeds' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{fqdn_rotate is "cdab"}) end end diff --git a/spec/acceptance/get_module_path_spec.rb b/spec/acceptance/get_module_path_spec.rb index 9fb685929..6d958f340 100755 --- a/spec/acceptance/get_module_path_spec.rb +++ b/spec/acceptance/get_module_path_spec.rb @@ -16,7 +16,7 @@ } EOS it 'get_module_paths dne' do - apply_manifest(pp, expect_failures: true) + apply_manifest(pp, :expect_failures => true) end end describe 'failure' do diff --git a/spec/acceptance/getparam_spec.rb b/spec/acceptance/getparam_spec.rb index b03eed0e1..98cd3f597 100755 --- a/spec/acceptance/getparam_spec.rb +++ b/spec/acceptance/getparam_spec.rb @@ -11,7 +11,7 @@ notice(inline_template('getparam is <%= @o.inspect %>')) EOS it 'getparam a notify' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{getparam is "custom rspec message"}) end end diff --git a/spec/acceptance/getvar_spec.rb b/spec/acceptance/getvar_spec.rb index 22a24dae6..cccf59d1e 100755 --- a/spec/acceptance/getvar_spec.rb +++ b/spec/acceptance/getvar_spec.rb @@ -13,7 +13,7 @@ class a::data { $foo = 'aoeu' } } EOS it 'getvars from classes' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/grep_spec.rb b/spec/acceptance/grep_spec.rb index a1a1f412b..f4e69c141 100755 --- a/spec/acceptance/grep_spec.rb +++ b/spec/acceptance/grep_spec.rb @@ -13,7 +13,7 @@ } EOS it 'greps arrays' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/has_interface_with_spec.rb b/spec/acceptance/has_interface_with_spec.rb index 58be6117b..617df8f02 100755 --- a/spec/acceptance/has_interface_with_spec.rb +++ b/spec/acceptance/has_interface_with_spec.rb @@ -1,7 +1,7 @@ #! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' -describe 'has_interface_with function', unless: ((fact('osfamily') == 'windows') || (fact('osfamily') == 'AIX')) do +describe 'has_interface_with function', :unless => ((fact('osfamily') == 'windows') || (fact('osfamily') == 'AIX')) do describe 'success' do pp1 = <<-EOS $a = $::ipaddress @@ -9,7 +9,7 @@ notice(inline_template('has_interface_with is <%= @o.inspect %>')) EOS it 'has_interface_with existing ipaddress' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{has_interface_with is true}) end end @@ -20,7 +20,7 @@ notice(inline_template('has_interface_with is <%= @o.inspect %>')) EOS it 'has_interface_with absent ipaddress' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{has_interface_with is false}) end end @@ -41,7 +41,7 @@ notice(inline_template('has_interface_with is <%= @o.inspect %>')) EOS it 'has_interface_with existing interface' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{has_interface_with is true}) end end diff --git a/spec/acceptance/has_ip_address_spec.rb b/spec/acceptance/has_ip_address_spec.rb index 7f4c89afa..84d2089b5 100755 --- a/spec/acceptance/has_ip_address_spec.rb +++ b/spec/acceptance/has_ip_address_spec.rb @@ -1,7 +1,7 @@ #! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' -describe 'has_ip_address function', unless: ((fact('osfamily') == 'windows') || (fact('osfamily') == 'AIX')) do +describe 'has_ip_address function', :unless => ((fact('osfamily') == 'windows') || (fact('osfamily') == 'AIX')) do describe 'success' do pp1 = <<-EOS $a = '127.0.0.1' @@ -9,7 +9,7 @@ notice(inline_template('has_ip_address is <%= @o.inspect %>')) EOS it 'has_ip_address existing ipaddress' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{has_ip_address is true}) end end @@ -20,7 +20,7 @@ notice(inline_template('has_ip_address is <%= @o.inspect %>')) EOS it 'has_ip_address absent ipaddress' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{has_ip_address is false}) end end diff --git a/spec/acceptance/has_ip_network_spec.rb b/spec/acceptance/has_ip_network_spec.rb index b2f81c3c5..6ce533c79 100755 --- a/spec/acceptance/has_ip_network_spec.rb +++ b/spec/acceptance/has_ip_network_spec.rb @@ -1,7 +1,7 @@ #! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' -describe 'has_ip_network function', unless: ((fact('osfamily') == 'windows') || (fact('osfamily') == 'AIX')) do +describe 'has_ip_network function', :unless => ((fact('osfamily') == 'windows') || (fact('osfamily') == 'AIX')) do describe 'success' do pp1 = <<-EOS $a = '127.0.0.0' @@ -9,7 +9,7 @@ notice(inline_template('has_ip_network is <%= @o.inspect %>')) EOS it 'has_ip_network existing ipaddress' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{has_ip_network is true}) end end @@ -20,7 +20,7 @@ notice(inline_template('has_ip_network is <%= @o.inspect %>')) EOS it 'has_ip_network absent ipaddress' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{has_ip_network is false}) end end diff --git a/spec/acceptance/has_key_spec.rb b/spec/acceptance/has_key_spec.rb index 3d024b403..6f41c63e7 100755 --- a/spec/acceptance/has_key_spec.rb +++ b/spec/acceptance/has_key_spec.rb @@ -13,7 +13,7 @@ } EOS it 'has_keys in hashes' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -28,7 +28,7 @@ } EOS it 'has_keys not in hashes' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/hash_spec.rb b/spec/acceptance/hash_spec.rb index 0ed90886d..f07945649 100755 --- a/spec/acceptance/hash_spec.rb +++ b/spec/acceptance/hash_spec.rb @@ -12,7 +12,7 @@ } EOS it 'hashs arrays' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/intersection_spec.rb b/spec/acceptance/intersection_spec.rb index a9dea7ff6..a5c2b3b4c 100755 --- a/spec/acceptance/intersection_spec.rb +++ b/spec/acceptance/intersection_spec.rb @@ -13,7 +13,7 @@ } EOS it 'intersections arrays' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/is_a_spec.rb b/spec/acceptance/is_a_spec.rb index 62570be0c..defdc2413 100644 --- a/spec/acceptance/is_a_spec.rb +++ b/spec/acceptance/is_a_spec.rb @@ -9,7 +9,7 @@ } EOS it 'matches a string' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -20,7 +20,7 @@ } EOS it 'does not match a integer as string' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).not_to match(%r{Notice: output wrong}) end end diff --git a/spec/acceptance/is_array_spec.rb b/spec/acceptance/is_array_spec.rb index b06b76dc0..202809358 100755 --- a/spec/acceptance/is_array_spec.rb +++ b/spec/acceptance/is_array_spec.rb @@ -12,7 +12,7 @@ } EOS it 'is_arrays arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'is_arrays empty arrays' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -40,7 +40,7 @@ } EOS it 'is_arrays strings' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -54,7 +54,7 @@ } EOS it 'is_arrays hashes' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/is_bool_spec.rb b/spec/acceptance/is_bool_spec.rb index fa962d335..aaad0d530 100755 --- a/spec/acceptance/is_bool_spec.rb +++ b/spec/acceptance/is_bool_spec.rb @@ -12,7 +12,7 @@ } EOS it 'is_bools arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'is_bools true' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -40,7 +40,7 @@ } EOS it 'is_bools false' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -54,7 +54,7 @@ } EOS it 'is_bools strings' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -68,7 +68,7 @@ } EOS it 'is_bools hashes' do - apply_manifest(pp5, catch_failures: true) do |r| + apply_manifest(pp5, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/is_domain_name_spec.rb b/spec/acceptance/is_domain_name_spec.rb index aa69a5a95..249ef1027 100755 --- a/spec/acceptance/is_domain_name_spec.rb +++ b/spec/acceptance/is_domain_name_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('is_domain_name is <%= @o.inspect %>')) EOS it 'is_domain_names arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_domain_name is false}) end end @@ -20,7 +20,7 @@ notice(inline_template('is_domain_name is <%= @o.inspect %>')) EOS it 'is_domain_names true' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_domain_name is false}) end end @@ -31,7 +31,7 @@ notice(inline_template('is_domain_name is <%= @o.inspect %>')) EOS it 'is_domain_names false' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_domain_name is false}) end end @@ -45,7 +45,7 @@ } EOS it 'is_domain_names strings with hyphens' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -59,7 +59,7 @@ } EOS it 'is_domain_names strings beginning with hyphens' do - apply_manifest(pp5, catch_failures: true) do |r| + apply_manifest(pp5, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -70,7 +70,7 @@ notice(inline_template('is_domain_name is <%= @o.inspect %>')) EOS it 'is_domain_names hashes' do - apply_manifest(pp6, catch_failures: true) do |r| + apply_manifest(pp6, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_domain_name is false}) end end diff --git a/spec/acceptance/is_float_spec.rb b/spec/acceptance/is_float_spec.rb index 1447dda4c..7656027bb 100755 --- a/spec/acceptance/is_float_spec.rb +++ b/spec/acceptance/is_float_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('is_float is <%= @o.inspect %>')) EOS it 'is_floats arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_float is false}) end end @@ -20,7 +20,7 @@ notice(inline_template('is_float is <%= @o.inspect %>')) EOS it 'is_floats true' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_float is false}) end end @@ -34,7 +34,7 @@ } EOS it 'is_floats strings' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -48,7 +48,7 @@ } EOS it 'is_floats floats' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -62,7 +62,7 @@ } EOS it 'is_floats integers' do - apply_manifest(pp5, catch_failures: true) do |r| + apply_manifest(pp5, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -73,7 +73,7 @@ notice(inline_template('is_float is <%= @o.inspect %>')) EOS it 'is_floats hashes' do - apply_manifest(pp6, catch_failures: true) do |r| + apply_manifest(pp6, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_float is false}) end end diff --git a/spec/acceptance/is_function_available_spec.rb b/spec/acceptance/is_function_available_spec.rb index a8827af35..4b939223e 100755 --- a/spec/acceptance/is_function_available_spec.rb +++ b/spec/acceptance/is_function_available_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('is_function_available is <%= @o.inspect %>')) EOS it 'is_function_availables arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_function_available is false}) end end @@ -20,7 +20,7 @@ notice(inline_template('is_function_available is <%= @o.inspect %>')) EOS it 'is_function_availables true' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_function_available is false}) end end @@ -34,7 +34,7 @@ } EOS it 'is_function_availables strings' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -45,7 +45,7 @@ notice(inline_template('is_function_available is <%= @o.inspect %>')) EOS it 'is_function_availables function_availables' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_function_available is true}) end end diff --git a/spec/acceptance/is_hash_spec.rb b/spec/acceptance/is_hash_spec.rb index 8cb9bec4e..35ea61053 100755 --- a/spec/acceptance/is_hash_spec.rb +++ b/spec/acceptance/is_hash_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('is_hash is <%= @o.inspect %>')) EOS it 'is_hashs arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_hash is false}) end end @@ -23,7 +23,7 @@ } EOS it 'is_hashs empty hashs' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -37,7 +37,7 @@ } EOS it 'is_hashs strings' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -51,7 +51,7 @@ } EOS it 'is_hashs hashes' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/is_integer_spec.rb b/spec/acceptance/is_integer_spec.rb index 693879235..4b1754863 100755 --- a/spec/acceptance/is_integer_spec.rb +++ b/spec/acceptance/is_integer_spec.rb @@ -12,7 +12,7 @@ } EOS it 'is_integers arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'is_integers true' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -40,7 +40,7 @@ } EOS it 'is_integers strings' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -54,7 +54,7 @@ } EOS it 'is_integers floats' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -68,7 +68,7 @@ } EOS it 'is_integers integers' do - apply_manifest(pp5, catch_failures: true) do |r| + apply_manifest(pp5, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -82,7 +82,7 @@ } EOS it 'is_integers hashes' do - apply_manifest(pp6, catch_failures: true) do |r| + apply_manifest(pp6, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/is_ip_address_spec.rb b/spec/acceptance/is_ip_address_spec.rb index c77fc0ef5..3316e56d8 100755 --- a/spec/acceptance/is_ip_address_spec.rb +++ b/spec/acceptance/is_ip_address_spec.rb @@ -12,7 +12,7 @@ } EOS it 'is_ip_addresss ipv4' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'is_ip_addresss ipv6' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -40,7 +40,7 @@ } EOS it 'is_ip_addresss ipv6 compressed' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -54,7 +54,7 @@ } EOS it 'is_ip_addresss strings' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -68,7 +68,7 @@ } EOS it 'is_ip_addresss ipv4 out of range' do - apply_manifest(pp5, catch_failures: true) do |r| + apply_manifest(pp5, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/is_ipv4_address_spec.rb b/spec/acceptance/is_ipv4_address_spec.rb index fab7b0148..f24050411 100755 --- a/spec/acceptance/is_ipv4_address_spec.rb +++ b/spec/acceptance/is_ipv4_address_spec.rb @@ -12,7 +12,7 @@ } EOS it 'is_ipv4_addresss' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'is_ipv4_addresss strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -40,7 +40,7 @@ } EOS it 'is_ipv4_addresss ipv4 out of range' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/is_ipv6_address_spec.rb b/spec/acceptance/is_ipv6_address_spec.rb index 90e1524a5..c765d59c6 100755 --- a/spec/acceptance/is_ipv6_address_spec.rb +++ b/spec/acceptance/is_ipv6_address_spec.rb @@ -12,7 +12,7 @@ } EOS it 'is_ipv6_addresss' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'is_ipv6_addresss ipv6 compressed' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -40,7 +40,7 @@ } EOS it 'is_ipv6_addresss strings' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -54,7 +54,7 @@ } EOS it 'is_ipv6_addresss ip out of range' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/is_mac_address_spec.rb b/spec/acceptance/is_mac_address_spec.rb index f6fc251fc..2d70cd935 100755 --- a/spec/acceptance/is_mac_address_spec.rb +++ b/spec/acceptance/is_mac_address_spec.rb @@ -12,7 +12,7 @@ } EOS it 'is_mac_addresss a mac' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'is_mac_addresss a mac out of range' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/is_numeric_spec.rb b/spec/acceptance/is_numeric_spec.rb index 1157dfb80..2c40698ff 100755 --- a/spec/acceptance/is_numeric_spec.rb +++ b/spec/acceptance/is_numeric_spec.rb @@ -12,7 +12,7 @@ } EOS it 'is_numerics arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'is_numerics true' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -40,7 +40,7 @@ } EOS it 'is_numerics strings' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -54,7 +54,7 @@ } EOS it 'is_numerics floats' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -68,7 +68,7 @@ } EOS it 'is_numerics integers' do - apply_manifest(pp5, catch_failures: true) do |r| + apply_manifest(pp5, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -82,7 +82,7 @@ } EOS it 'is_numerics hashes' do - apply_manifest(pp6, catch_failures: true) do |r| + apply_manifest(pp6, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/is_string_spec.rb b/spec/acceptance/is_string_spec.rb index 7d5d10bcc..7451f45bd 100755 --- a/spec/acceptance/is_string_spec.rb +++ b/spec/acceptance/is_string_spec.rb @@ -12,7 +12,7 @@ } EOS it 'is_strings arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -26,7 +26,7 @@ } EOS it 'is_strings true' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -37,7 +37,7 @@ notice(inline_template('is_string is <%= @o.inspect %>')) EOS it 'is_strings strings' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_string is true}) end end @@ -48,7 +48,7 @@ notice(inline_template('is_string is <%= @o.inspect %>')) EOS it 'is_strings number strings' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_string is false}) end end @@ -62,7 +62,7 @@ } EOS it 'is_strings floats' do - apply_manifest(pp5, catch_failures: true) do |r| + apply_manifest(pp5, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -76,7 +76,7 @@ } EOS it 'is_strings integers' do - apply_manifest(pp6, catch_failures: true) do |r| + apply_manifest(pp6, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -90,7 +90,7 @@ } EOS it 'is_strings hashes' do - apply_manifest(pp7, catch_failures: true) do |r| + apply_manifest(pp7, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -101,7 +101,7 @@ notice(inline_template('is_string is <%= @o.inspect %>')) EOS it 'is_strings undef' do - apply_manifest(pp8, catch_failures: true) do |r| + apply_manifest(pp8, :catch_failures => true) do |r| expect(r.stdout).to match(%r{is_string is true}) end end diff --git a/spec/acceptance/join_keys_to_values_spec.rb b/spec/acceptance/join_keys_to_values_spec.rb index 8b30f208a..46bf61785 100755 --- a/spec/acceptance/join_keys_to_values_spec.rb +++ b/spec/acceptance/join_keys_to_values_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('join_keys_to_values is <%= @o.sort.inspect %>')) EOS it 'join_keys_to_valuess hashes' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{join_keys_to_values is \["aaa:bbb", "ccc:ddd"\]}) end end diff --git a/spec/acceptance/join_spec.rb b/spec/acceptance/join_spec.rb index 95b367552..6bd0cbce4 100755 --- a/spec/acceptance/join_spec.rb +++ b/spec/acceptance/join_spec.rb @@ -13,7 +13,7 @@ } EOS it 'joins arrays' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/keys_spec.rb b/spec/acceptance/keys_spec.rb index 06b01f8bc..332e368d8 100755 --- a/spec/acceptance/keys_spec.rb +++ b/spec/acceptance/keys_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('keys is <%= @o.sort.inspect %>')) EOS it 'keyss hashes' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{keys is \["aaa", "ccc"\]}) end end diff --git a/spec/acceptance/loadjson_spec.rb b/spec/acceptance/loadjson_spec.rb index 8665730a0..5aaaeff1d 100644 --- a/spec/acceptance/loadjson_spec.rb +++ b/spec/acceptance/loadjson_spec.rb @@ -15,7 +15,7 @@ EOS regex_array = [%r{loadjson\[aaa\] is 1}, %r{loadjson\[bbb\] is 2}, %r{loadjson\[ccc\] is 3}, %r{loadjson\[ddd\] is 4}] it 'loadjsons array of values' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| regex_array.each do |i| expect(r.stdout).to match(i) end @@ -27,7 +27,7 @@ notice(inline_template('loadjson[default] is <%= @o["default"].inspect %>')) EOS it 'returns the default value if there is no file to load' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{loadjson\[default\] is "value"}) end end @@ -38,7 +38,7 @@ notice(inline_template('loadjson[default] is <%= @o["default"].inspect %>')) EOS it 'returns the default value if the file was parsed with an error' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{loadjson\[default\] is "value"}) end end diff --git a/spec/acceptance/loadyaml_spec.rb b/spec/acceptance/loadyaml_spec.rb index 721d42892..96cafc772 100644 --- a/spec/acceptance/loadyaml_spec.rb +++ b/spec/acceptance/loadyaml_spec.rb @@ -19,7 +19,7 @@ EOS regex_array = [%r{loadyaml\[aaa\] is 1}, %r{loadyaml\[bbb\] is 2}, %r{loadyaml\[ccc\] is 3}, %r{loadyaml\[ddd\] is 4}] it 'loadyamls array of values' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| regex_array.each do |i| expect(r.stdout).to match(i) end @@ -31,7 +31,7 @@ notice(inline_template('loadyaml[default] is <%= @o["default"].inspect %>')) EOS it 'returns the default value if there is no file to load' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{loadyaml\[default\] is "value"}) end end @@ -42,7 +42,7 @@ notice(inline_template('loadyaml[default] is <%= @o["default"].inspect %>')) EOS it 'returns the default value if the file was parsed with an error' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{loadyaml\[default\] is "value"}) end end diff --git a/spec/acceptance/lstrip_spec.rb b/spec/acceptance/lstrip_spec.rb index c0739abfe..a7fe8da92 100755 --- a/spec/acceptance/lstrip_spec.rb +++ b/spec/acceptance/lstrip_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('lstrip is <%= @o.inspect %>')) EOS it 'lstrips arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{lstrip is \["the ", "public ", "art", "galleries "\]}) end end @@ -21,7 +21,7 @@ notice(inline_template('lstrip is <%= @o.inspect %>')) EOS it 'lstrips strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{lstrip is "blowzy night-frumps vex'd jack q "}) end end diff --git a/spec/acceptance/max_spec.rb b/spec/acceptance/max_spec.rb index 2b903866b..c1cf67137 100755 --- a/spec/acceptance/max_spec.rb +++ b/spec/acceptance/max_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('max is <%= @o.inspect %>')) EOS it 'maxs arrays' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{max is "the"}) end end diff --git a/spec/acceptance/member_spec.rb b/spec/acceptance/member_spec.rb index 96232a762..ee8f2b233 100755 --- a/spec/acceptance/member_spec.rb +++ b/spec/acceptance/member_spec.rb @@ -4,7 +4,7 @@ describe 'member function' do shared_examples 'item found' do it 'outputs correctly' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end @@ -20,7 +20,7 @@ } EOS it 'members arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{Notice: output correct}) end end diff --git a/spec/acceptance/merge_spec.rb b/spec/acceptance/merge_spec.rb index 5ce305503..1528ad949 100755 --- a/spec/acceptance/merge_spec.rb +++ b/spec/acceptance/merge_spec.rb @@ -13,7 +13,7 @@ EOS regex_array = [%r{merge\[one\] is ("1"|1)}, %r{merge\[two\] is "dos"}, %r{merge\[three\] is {"five"=>("5"|5)}}] it 'merges two hashes' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| regex_array.each do |i| expect(r.stdout).to match(i) end diff --git a/spec/acceptance/min_spec.rb b/spec/acceptance/min_spec.rb index fd12e2a7a..f011c64e4 100755 --- a/spec/acceptance/min_spec.rb +++ b/spec/acceptance/min_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('min is <%= @o.inspect %>')) EOS it 'mins arrays' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{min is "art"}) end end diff --git a/spec/acceptance/num2bool_spec.rb b/spec/acceptance/num2bool_spec.rb index 41cad9031..24f95dfcc 100755 --- a/spec/acceptance/num2bool_spec.rb +++ b/spec/acceptance/num2bool_spec.rb @@ -16,7 +16,7 @@ EOS regex_array_true = [%r{a is true}, %r{b is true}, %r{c is true}] it 'bools positive numbers and numeric strings as true' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| regex_array_true.each do |i| expect(r.stdout).to match(i) end @@ -36,7 +36,7 @@ EOS regex_array_false = [%r{a is false}, %r{b is false}, %r{c is false}] it 'bools negative numbers as false' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| regex_array_false.each do |i| expect(r.stdout).to match(i) end @@ -51,7 +51,7 @@ notice(inline_template('a is <%= @ao.inspect %>')) EOS it 'fails on words' do - expect(apply_manifest(pp3, expect_failures: true).stderr).to match(%r{not look like a number}) + expect(apply_manifest(pp3, :expect_failures => true).stderr).to match(%r{not look like a number}) end pp4 = <<-EOS @@ -60,7 +60,7 @@ notice(inline_template('b is <%= @bo.inspect %>')) EOS it 'fails on numberwords' do - expect(apply_manifest(pp4, expect_failures: true).stderr).to match(%r{not look like a number}) + expect(apply_manifest(pp4, :expect_failures => true).stderr).to match(%r{not look like a number}) end pp5 = <<-EOS # rubocop:disable Lint/UselessAssignment @@ -71,7 +71,7 @@ it 'fails on non-numeric/strings' do pending "The function will call .to_s.to_i on anything not a Numeric or String, and results in 0. Is this intended?" - expect(apply_manifest(pp5(expect_failures: true)).stderr).to match(%r{Unable to parse}) + expect(apply_manifest(pp5(:expect_failures => true)).stderr).to match(%r{Unable to parse}) end end end diff --git a/spec/acceptance/parsejson_spec.rb b/spec/acceptance/parsejson_spec.rb index 1dcfd5514..109936981 100755 --- a/spec/acceptance/parsejson_spec.rb +++ b/spec/acceptance/parsejson_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('tests are <%= @tests.inspect %>')) EOS it 'parses valid json' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{tests are "passing"}) end end @@ -23,7 +23,7 @@ notice(inline_template('a is <%= @ao.inspect %>')) EOS it 'raises error on incorrect json - default value is used' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{tests are using the default value}) end end @@ -34,7 +34,7 @@ notice(inline_template('a is <%= @ao.inspect %>')) EOS it 'raises error on incorrect json' do - apply_manifest(pp3, expect_failures: true) do |r| + apply_manifest(pp3, :expect_failures => true) do |r| expect(r.stderr).to match(%r{expected next name}) end end @@ -43,7 +43,7 @@ $o = parsejson() EOS it 'raises error on incorrect number of arguments' do - apply_manifest(pp4, expect_failures: true) do |r| + apply_manifest(pp4, :expect_failures => true) do |r| expect(r.stderr).to match(%r{wrong number of arguments}i) end end diff --git a/spec/acceptance/parseyaml_spec.rb b/spec/acceptance/parseyaml_spec.rb index 985c45629..329eccf39 100755 --- a/spec/acceptance/parseyaml_spec.rb +++ b/spec/acceptance/parseyaml_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('tests are <%= @tests.inspect %>')) EOS it 'parses valid yaml' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{tests are "passing"}) end end @@ -24,7 +24,7 @@ notice(inline_template('tests are <%= @tests.inspect %>')) EOS it 'returns the default value on incorrect yaml' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{tests are "using the default value"}) end end @@ -36,7 +36,7 @@ notice(inline_template('tests are <%= @tests.inspect %>')) EOS it 'raises error on incorrect yaml' do - apply_manifest(pp3, expect_failures: true) do |r| + apply_manifest(pp3, :expect_failures => true) do |r| expect(r.stderr).to match(%r{(syntax error|did not find expected key)}) end end @@ -45,7 +45,7 @@ $o = parseyaml() EOS it 'raises error on incorrect number of arguments' do - apply_manifest(pp4, expect_failures: true) do |r| + apply_manifest(pp4, :expect_failures => true) do |r| expect(r.stderr).to match(%r{wrong number of arguments}i) end end diff --git a/spec/acceptance/pick_default_spec.rb b/spec/acceptance/pick_default_spec.rb index 473768942..b641fe6b4 100755 --- a/spec/acceptance/pick_default_spec.rb +++ b/spec/acceptance/pick_default_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('picked is <%= @o.inspect %>')) EOS it 'pick_defaults a default value' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{picked is "default"}) end end @@ -21,7 +21,7 @@ notice(inline_template('picked is <%= @o.inspect %>')) EOS it 'pick_defaults with no value' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{picked is ""}) end end @@ -33,7 +33,7 @@ notice(inline_template('picked is <%= @o.inspect %>')) EOS it 'pick_defaults the first set value' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{picked is "something"}) end end @@ -44,7 +44,7 @@ notice(inline_template('picked is <%= @o.inspect %>')) EOS it 'raises error with no values' do - apply_manifest(pp4, expect_failures: true) do |r| + apply_manifest(pp4, :expect_failures => true) do |r| expect(r.stderr).to match(%r{Must receive at least one argument}) end end diff --git a/spec/acceptance/pick_spec.rb b/spec/acceptance/pick_spec.rb index 8ab9e00b7..06a6269fa 100755 --- a/spec/acceptance/pick_spec.rb +++ b/spec/acceptance/pick_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('picked is <%= @o.inspect %>')) EOS it 'picks a default value' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{picked is "default"}) end end @@ -21,7 +21,7 @@ notice(inline_template('picked is <%= @o.inspect %>')) EOS it 'picks the first set value' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{picked is "something"}) end end @@ -35,7 +35,7 @@ notice(inline_template('picked is <%= @o.inspect %>')) EOS it 'raises error with all undef values' do - apply_manifest(pp3, expect_failures: true) do |r| + apply_manifest(pp3, :expect_failures => true) do |r| expect(r.stderr).to match(%r{must receive at least one non empty value}) end end diff --git a/spec/acceptance/prefix_spec.rb b/spec/acceptance/prefix_spec.rb index d5efe25bc..9b09b1541 100755 --- a/spec/acceptance/prefix_spec.rb +++ b/spec/acceptance/prefix_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('prefix is <%= @o.inspect %>')) EOS it 'prefixes array of values' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{prefix is \["pa", "pb", "pc"\]}) end end @@ -18,7 +18,7 @@ notice(inline_template('prefix is <%= @o.inspect %>')) EOS it 'prefixs with empty array' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{prefix is \[\]}) end end @@ -28,7 +28,7 @@ notice(inline_template('prefix is <%= @o.inspect %>')) EOS it 'prefixs array of values with undef' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{prefix is \["a", "b", "c"\]}) end end diff --git a/spec/acceptance/pw_hash_spec.rb b/spec/acceptance/pw_hash_spec.rb index 6e0a9cf90..4e365a133 100644 --- a/spec/acceptance/pw_hash_spec.rb +++ b/spec/acceptance/pw_hash_spec.rb @@ -2,14 +2,14 @@ require 'spec_helper_acceptance' # Windows and OS X do not have useful implementations of crypt(3) -describe 'pw_hash function', unless: %w[windows Darwin SLES].include?(fact('operatingsystem')) do +describe 'pw_hash function', :unless => %w[windows Darwin SLES].include?(fact('operatingsystem')) do describe 'success' do pp1 = <<-EOS $o = pw_hash('password', 'sha-512', 'salt') notice(inline_template('pw_hash is <%= @o.inspect %>')) EOS it 'hashes passwords' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{pw_hash is "\$6\$salt\$IxDD3jeSOb5eB1CX5LBsqZFVkJdido3OUILO5Ifz5iwMuTS4XMS130MTSuDDl3aCI6WouIL9AjRbLCelDCy\.g\."}) end end @@ -19,7 +19,7 @@ notice(inline_template('pw_hash is <%= @o.inspect %>')) EOS it 'returns nil if no password is provided' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{pw_hash is nil}) end end diff --git a/spec/acceptance/range_spec.rb b/spec/acceptance/range_spec.rb index 6bc9aeed2..2783cc8bb 100755 --- a/spec/acceptance/range_spec.rb +++ b/spec/acceptance/range_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('range is <%= @o.inspect %>')) EOS it 'ranges letters' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{range is \["a", "b", "c", "d"\]}) end end @@ -18,7 +18,7 @@ notice(inline_template('range is <%= @o.inspect %>')) EOS it 'ranges letters with a step' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{range is \["a", "c"\]}) end end diff --git a/spec/acceptance/reject_spec.rb b/spec/acceptance/reject_spec.rb index a9983e114..6b16c07f8 100755 --- a/spec/acceptance/reject_spec.rb +++ b/spec/acceptance/reject_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('reject is <%= @o.inspect %>')) EOS it 'rejects array of values' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{reject is \["bbb", "ccc"\]}) end end @@ -18,7 +18,7 @@ notice(inline_template('reject is <%= @o.inspect %>')) EOS it 'rejects with empty array' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{reject is \[\]}) end end @@ -28,7 +28,7 @@ notice(inline_template('reject is <%= @o.inspect %>')) EOS it 'rejects array of values with undef' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{reject is \[\]}) end end diff --git a/spec/acceptance/reverse_spec.rb b/spec/acceptance/reverse_spec.rb index f8759cc8c..18e2d238f 100755 --- a/spec/acceptance/reverse_spec.rb +++ b/spec/acceptance/reverse_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('reverse is <%= @o.inspect %>')) EOS it 'reverses strings' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{reverse is "seirellag tra cilbup eht"}) end end diff --git a/spec/acceptance/rstrip_spec.rb b/spec/acceptance/rstrip_spec.rb index 0616aa701..335bcdc36 100755 --- a/spec/acceptance/rstrip_spec.rb +++ b/spec/acceptance/rstrip_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('rstrip is <%= @o.inspect %>')) EOS it 'rstrips arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{rstrip is \[" the", " public", " art", "galleries"\]}) end end @@ -21,7 +21,7 @@ notice(inline_template('rstrip is <%= @o.inspect %>')) EOS it 'rstrips strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{rstrip is " blowzy night-frumps vex'd jack q"}) end end diff --git a/spec/acceptance/shuffle_spec.rb b/spec/acceptance/shuffle_spec.rb index 99a74776e..e561b26aa 100755 --- a/spec/acceptance/shuffle_spec.rb +++ b/spec/acceptance/shuffle_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('shuffle is <%= @o.inspect %>')) EOS it 'shuffles arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).not_to match(%r{shuffle is \["1", "2", "3", "4", "5", "6", "7", "8", "the", "public", "art", "galleries"\]}) end end @@ -21,7 +21,7 @@ notice(inline_template('shuffle is <%= @o.inspect %>')) EOS it 'shuffles strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).not_to match(%r{shuffle is "blowzy night-frumps vex'd jack q"}) end end diff --git a/spec/acceptance/size_spec.rb b/spec/acceptance/size_spec.rb index dc8f2bd6c..6c4e9f47b 100755 --- a/spec/acceptance/size_spec.rb +++ b/spec/acceptance/size_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('size is <%= @o.inspect %>')) EOS it 'single string size' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{size is 14}) end end @@ -20,7 +20,7 @@ notice(inline_template('size is <%= @o.inspect %>')) EOS it 'with empty string' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{size is 0}) end end @@ -31,7 +31,7 @@ notice(inline_template('size is <%= @o.inspect %>')) EOS it 'with undef' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{size is 0}) end end @@ -42,7 +42,7 @@ notice(inline_template('size is <%= @o.inspect %>')) EOS it 'strings in array' do - apply_manifest(pp4, catch_failures: true) do |r| + apply_manifest(pp4, :catch_failures => true) do |r| expect(r.stdout).to match(%r{size is 2}) end end diff --git a/spec/acceptance/sort_spec.rb b/spec/acceptance/sort_spec.rb index a9fb5b541..6feedd7aa 100755 --- a/spec/acceptance/sort_spec.rb +++ b/spec/acceptance/sort_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('sort is <%= @o.inspect %>')) EOS it 'sorts arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{sort is \["art", "galleries", "public", "the"\]}) end end @@ -21,7 +21,7 @@ notice(inline_template('sort is <%= @o.inspect %>')) EOS it 'sorts strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{sort is " '-abcdefghijklmnopqrstuvwxyz"}) end end diff --git a/spec/acceptance/squeeze_spec.rb b/spec/acceptance/squeeze_spec.rb index 97d0917a4..9cd2b2605 100755 --- a/spec/acceptance/squeeze_spec.rb +++ b/spec/acceptance/squeeze_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('squeeze is <%= @o.inspect %>')) EOS it 'squeezes arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{squeeze is \["wales", "laparohysterosalpingophorectomy", "br", "godeship"\]}) end end @@ -22,7 +22,7 @@ notice(inline_template('squeeze is <%= @o.inspect %>')) EOS it 'squeezes strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{squeeze is "wales laparohysterosalpingophorectomy br godeship"}) end end @@ -33,7 +33,7 @@ notice(inline_template('squeeze is <%= @o.inspect %>')) EOS it 'squeezes strings with an argument' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{squeeze is "counteship ducheship governeship hosteship"}) end end diff --git a/spec/acceptance/str2bool_spec.rb b/spec/acceptance/str2bool_spec.rb index 06558b360..c36e32bd9 100755 --- a/spec/acceptance/str2bool_spec.rb +++ b/spec/acceptance/str2bool_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('str2bool is <%= @o.inspect %>')) EOS it 'works with "y"' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{str2bool is true}) end end diff --git a/spec/acceptance/str2saltedsha512_spec.rb b/spec/acceptance/str2saltedsha512_spec.rb index 6bff4eb93..832befa59 100755 --- a/spec/acceptance/str2saltedsha512_spec.rb +++ b/spec/acceptance/str2saltedsha512_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('str2saltedsha512 is <%= @o.inspect %>')) EOS it 'works with "y"' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{str2saltedsha512 is "[a-f0-9]{136}"}) end end diff --git a/spec/acceptance/strftime_spec.rb b/spec/acceptance/strftime_spec.rb index d2973f0af..49a89098b 100755 --- a/spec/acceptance/strftime_spec.rb +++ b/spec/acceptance/strftime_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('strftime is <%= @o.inspect %>')) EOS it 'gives the Century' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{strftime is "20"}) end end diff --git a/spec/acceptance/strip_spec.rb b/spec/acceptance/strip_spec.rb index cd6599c59..fb7f76606 100755 --- a/spec/acceptance/strip_spec.rb +++ b/spec/acceptance/strip_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('strip is <%= @o.inspect %>')) EOS it 'strips arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{strip is \["the", "public", "art", "galleries"\]}) end end @@ -21,7 +21,7 @@ notice(inline_template('strip is <%= @o.inspect %>')) EOS it 'strips strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{strip is "blowzy night-frumps vex'd jack q"}) end end diff --git a/spec/acceptance/suffix_spec.rb b/spec/acceptance/suffix_spec.rb index d1cabf11f..93ac25710 100755 --- a/spec/acceptance/suffix_spec.rb +++ b/spec/acceptance/suffix_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('suffix is <%= @o.inspect %>')) EOS it 'suffixes array of values' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{suffix is \["ap", "bp", "cp"\]}) end end @@ -18,7 +18,7 @@ notice(inline_template('suffix is <%= @o.inspect %>')) EOS it 'suffixs with empty array' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{suffix is \[\]}) end end @@ -28,7 +28,7 @@ notice(inline_template('suffix is <%= @o.inspect %>')) EOS it 'suffixs array of values with undef' do - apply_manifest(pp3, catch_failures: true) do |r| + apply_manifest(pp3, :catch_failures => true) do |r| expect(r.stdout).to match(%r{suffix is \["a", "b", "c"\]}) end end diff --git a/spec/acceptance/swapcase_spec.rb b/spec/acceptance/swapcase_spec.rb index c23235ef0..782a3d543 100755 --- a/spec/acceptance/swapcase_spec.rb +++ b/spec/acceptance/swapcase_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('swapcase is <%= @o.inspect %>')) EOS it 'works with strings' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{swapcase is "AbCd"}) end end diff --git a/spec/acceptance/time_spec.rb b/spec/acceptance/time_spec.rb index 390b5f849..784fde294 100755 --- a/spec/acceptance/time_spec.rb +++ b/spec/acceptance/time_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('time is <%= @o.inspect %>')) EOS it 'gives the time' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| m = r.stdout.match(%r{time is (\d+)\D}) # When I wrote this test expect(Integer(m[1])).to be > 1_398_894_170 @@ -20,7 +20,7 @@ notice(inline_template('time is <%= @o.inspect %>')) EOS it 'takes a timezone argument' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| m = r.stdout.match(%r{time is (\d+)\D}) expect(Integer(m[1])).to be > 1_398_894_170 end diff --git a/spec/acceptance/to_bytes_spec.rb b/spec/acceptance/to_bytes_spec.rb index 9fb898fdd..20bcff394 100755 --- a/spec/acceptance/to_bytes_spec.rb +++ b/spec/acceptance/to_bytes_spec.rb @@ -8,7 +8,7 @@ notice(inline_template('to_bytes is <%= @o.inspect %>')) EOS it 'converts kB to B' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| m = r.stdout.match(%r{to_bytes is (\d+)\D}) expect(m[1]).to eq('4096') end diff --git a/spec/acceptance/try_get_value_spec.rb b/spec/acceptance/try_get_value_spec.rb index 5bf461c4d..dd512e450 100755 --- a/spec/acceptance/try_get_value_spec.rb +++ b/spec/acceptance/try_get_value_spec.rb @@ -12,7 +12,7 @@ notice(inline_template('tests are <%= @tests.inspect %>')) EOS it 'gets a value' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{tests are "passing"}) end end @@ -28,7 +28,7 @@ notice(inline_template('tests are <%= @tests.inspect %>')) EOS it 'uses a default value' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{using the default value}) end end @@ -37,7 +37,7 @@ $o = try_get_value() EOS it 'raises error on incorrect number of arguments' do - apply_manifest(pp, expect_failures: true) do |r| + apply_manifest(pp, :expect_failures => true) do |r| expect(r.stderr).to match(%r{wrong number of arguments}i) end end diff --git a/spec/acceptance/type_spec.rb b/spec/acceptance/type_spec.rb index 57ed16d57..777bb23f7 100755 --- a/spec/acceptance/type_spec.rb +++ b/spec/acceptance/type_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('type is <%= @o.to_s %>')) EOS it 'types arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{type is Tuple\[String.*, String.*, String.*, String.*\]}) end end @@ -21,7 +21,7 @@ notice(inline_template('type is <%= @o.to_s %>')) EOS it 'types strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{type is String}) end end diff --git a/spec/acceptance/union_spec.rb b/spec/acceptance/union_spec.rb index dd0793b4e..0965ab0b9 100755 --- a/spec/acceptance/union_spec.rb +++ b/spec/acceptance/union_spec.rb @@ -12,7 +12,7 @@ notice(inline_template('union is <%= @o.inspect %>')) EOS it 'unions arrays' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{union is \["the", "public", "art", "galleries"\]}) end end diff --git a/spec/acceptance/unique_spec.rb b/spec/acceptance/unique_spec.rb index 14369dfcd..ea8455fad 100755 --- a/spec/acceptance/unique_spec.rb +++ b/spec/acceptance/unique_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('unique is <%= @o.inspect %>')) EOS it 'uniques arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{unique is \["wallless", "brrr", "goddessship"\]}) end end @@ -20,7 +20,7 @@ notice(inline_template('unique is <%= @o.inspect %>')) EOS it 'uniques strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{unique is "wales prohytingcmbd"}) end end diff --git a/spec/acceptance/upcase_spec.rb b/spec/acceptance/upcase_spec.rb index 522ff0d4a..f153dcb04 100755 --- a/spec/acceptance/upcase_spec.rb +++ b/spec/acceptance/upcase_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('upcase is <%= @o.inspect %>')) EOS it 'upcases arrays' do - apply_manifest(pp1, catch_failures: true) do |r| + apply_manifest(pp1, :catch_failures => true) do |r| expect(r.stdout).to match(%r{upcase is \["WALLLESS", "LAPAROHYSTEROSALPINGOOOPHORECTOMY", "BRRR", "GODDESSSHIP"\]}) end end @@ -20,7 +20,7 @@ notice(inline_template('upcase is <%= @o.inspect %>')) EOS it 'upcases strings' do - apply_manifest(pp2, catch_failures: true) do |r| + apply_manifest(pp2, :catch_failures => true) do |r| expect(r.stdout).to match(%r{upcase is "WALLLESS LAPAROHYSTEROSALPINGOOOPHORECTOMY BRRR GODDESSSHIP"}) end end diff --git a/spec/acceptance/uriescape_spec.rb b/spec/acceptance/uriescape_spec.rb index 0f3d13acb..d3b39fadc 100755 --- a/spec/acceptance/uriescape_spec.rb +++ b/spec/acceptance/uriescape_spec.rb @@ -9,7 +9,7 @@ notice(inline_template('uriescape is <%= @o.inspect %>')) EOS it 'uriescape strings' do - apply_manifest(pp, catch_failures: true) do |r| + apply_manifest(pp, :catch_failures => true) do |r| expect(r.stdout).to match(%r{uriescape is ":\/\?%23\[\]@!\$&'\(\)\*\+,;=%20%22%7B%7D"}) end end diff --git a/spec/acceptance/validate_absolute_path_spec.rb b/spec/acceptance/validate_absolute_path_spec.rb index cba8a64d7..fec28174b 100755 --- a/spec/acceptance/validate_absolute_path_spec.rb +++ b/spec/acceptance/validate_absolute_path_spec.rb @@ -19,7 +19,7 @@ validate_absolute_path($one) EOS it "validates a single argument #{path}" do - apply_manifest(pp, catch_failures: true) + apply_manifest(pp, :catch_failures => true) end end end diff --git a/spec/acceptance/validate_array_spec.rb b/spec/acceptance/validate_array_spec.rb index b91dc8e10..8116fd2ce 100755 --- a/spec/acceptance/validate_array_spec.rb +++ b/spec/acceptance/validate_array_spec.rb @@ -8,7 +8,7 @@ validate_array($one) EOS it 'validates a single argument' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-EOS @@ -17,7 +17,7 @@ validate_array($one,$two) EOS it 'validates an multiple arguments' do - apply_manifest(pp2, catch_failures: true) + apply_manifest(pp2, :catch_failures => true) end [ %{validate_array({'a' => 'hash' })}, @@ -26,7 +26,7 @@ %{validate_array(undef)}, ].each do |pp| it "rejects #{pp.inspect}" do - expect(apply_manifest(pp, expect_failures: true).stderr).to match(%r{is not an Array\. It looks to be a}) + expect(apply_manifest(pp, :expect_failures => true).stderr).to match(%r{is not an Array\. It looks to be a}) end end end diff --git a/spec/acceptance/validate_augeas_spec.rb b/spec/acceptance/validate_augeas_spec.rb index d08a1ca4d..098ff280e 100755 --- a/spec/acceptance/validate_augeas_spec.rb +++ b/spec/acceptance/validate_augeas_spec.rb @@ -1,7 +1,7 @@ #! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' -describe 'validate_augeas function', unless: (fact('osfamily') == 'windows') do +describe 'validate_augeas function', :unless => (fact('osfamily') == 'windows') do describe 'prep' do it 'installs augeas for tests' end @@ -17,7 +17,7 @@ validate_augeas($line, $lens) EOS it "validates a single argument for #{lens}" do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end end end @@ -33,7 +33,7 @@ validate_augeas($line, $lens, $restriction, "my custom failure message") EOS it 'validates a restricted value' do - expect(apply_manifest(pp2, expect_failures: true).stderr).to match(%r{my custom failure message}) + expect(apply_manifest(pp2, :expect_failures => true).stderr).to match(%r{my custom failure message}) end end @@ -48,7 +48,7 @@ validate_augeas($line, $lens) EOS it "validates a single argument for #{lens}" do - apply_manifest(pp3, expect_failures: true) + apply_manifest(pp3, :expect_failures => true) end end end diff --git a/spec/acceptance/validate_bool_spec.rb b/spec/acceptance/validate_bool_spec.rb index 1c25b681a..0d1ab2f69 100755 --- a/spec/acceptance/validate_bool_spec.rb +++ b/spec/acceptance/validate_bool_spec.rb @@ -8,7 +8,7 @@ validate_bool($one) EOS it 'validates a single argument' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-EOS @@ -17,7 +17,7 @@ validate_bool($one,$two) EOS it 'validates an multiple arguments' do - apply_manifest(pp2, catch_failures: true) + apply_manifest(pp2, :catch_failures => true) end [ %{validate_bool('true')}, @@ -26,7 +26,7 @@ %{validate_bool(undef)}, ].each do |pp3| it "rejects #{pp3.inspect}" do - expect(apply_manifest(pp3, expect_failures: true).stderr).to match(%r{is not a boolean\. It looks to be a}) + expect(apply_manifest(pp3, :expect_failures => true).stderr).to match(%r{is not a boolean\. It looks to be a}) end end end diff --git a/spec/acceptance/validate_cmd_spec.rb b/spec/acceptance/validate_cmd_spec.rb index 5f1da6b97..d6abceb86 100755 --- a/spec/acceptance/validate_cmd_spec.rb +++ b/spec/acceptance/validate_cmd_spec.rb @@ -13,7 +13,7 @@ validate_cmd($one,$two) EOS it 'validates a true command' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-EOS @@ -26,7 +26,7 @@ validate_cmd($one,$two) EOS it 'validates a fail command' do - apply_manifest(pp2, expect_failures: true) + apply_manifest(pp2, :expect_failures => true) end pp3 = <<-EOS @@ -39,7 +39,7 @@ validate_cmd($one,$two,"aoeu is dvorak") EOS it 'validates a fail command with a custom error message' do - apply_manifest(pp3, expect_failures: true) do |output| + apply_manifest(pp3, :expect_failures => true) do |output| expect(output.stderr).to match(%r{aoeu is dvorak}) end end diff --git a/spec/acceptance/validate_hash_spec.rb b/spec/acceptance/validate_hash_spec.rb index a81f69df0..075bed139 100755 --- a/spec/acceptance/validate_hash_spec.rb +++ b/spec/acceptance/validate_hash_spec.rb @@ -8,7 +8,7 @@ validate_hash($one) EOS it 'validates a single argument' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-EOS @@ -17,7 +17,7 @@ validate_hash($one,$two) EOS it 'validates an multiple arguments' do - apply_manifest(pp2, catch_failures: true) + apply_manifest(pp2, :catch_failures => true) end [ @@ -27,7 +27,7 @@ %{validate_hash(undef)}, ].each do |pp3| it "rejects #{pp3.inspect}" do - expect(apply_manifest(pp3, expect_failures: true).stderr).to match(%r{}) + expect(apply_manifest(pp3, :expect_failures => true).stderr).to match(%r{}) end end end diff --git a/spec/acceptance/validate_ipv4_address_spec.rb b/spec/acceptance/validate_ipv4_address_spec.rb index a26db2a50..7c1c9d136 100755 --- a/spec/acceptance/validate_ipv4_address_spec.rb +++ b/spec/acceptance/validate_ipv4_address_spec.rb @@ -8,7 +8,7 @@ validate_ipv4_address($one) EOS it 'validates a single argument' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-EOS @@ -17,7 +17,7 @@ validate_ipv4_address($one,$two) EOS it 'validates an multiple arguments' do - apply_manifest(pp2, catch_failures: true) + apply_manifest(pp2, :catch_failures => true) end end describe 'failure' do diff --git a/spec/acceptance/validate_ipv6_address_spec.rb b/spec/acceptance/validate_ipv6_address_spec.rb index 201e35606..ae546ad6a 100755 --- a/spec/acceptance/validate_ipv6_address_spec.rb +++ b/spec/acceptance/validate_ipv6_address_spec.rb @@ -8,7 +8,7 @@ validate_ipv6_address($one) EOS it 'validates a single argument' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-EOS @@ -17,7 +17,7 @@ validate_ipv6_address($one,$two) EOS it 'validates an multiple arguments' do - apply_manifest(pp2, catch_failures: true) + apply_manifest(pp2, :catch_failures => true) end end describe 'failure' do diff --git a/spec/acceptance/validate_re_spec.rb b/spec/acceptance/validate_re_spec.rb index b3ae129b8..0679ef03c 100755 --- a/spec/acceptance/validate_re_spec.rb +++ b/spec/acceptance/validate_re_spec.rb @@ -9,7 +9,7 @@ validate_re($one,$two) EOS it 'validates a string' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-EOS @@ -18,7 +18,7 @@ validate_re($one,$two) EOS it 'validates an array' do - apply_manifest(pp2, catch_failures: true) + apply_manifest(pp2, :catch_failures => true) end pp3 = <<-EOS @@ -27,7 +27,7 @@ validate_re($one,$two) EOS it 'validates a failed array' do - apply_manifest(pp3, expect_failures: true) + apply_manifest(pp3, :expect_failures => true) end pp4 = <<-EOS @@ -36,7 +36,7 @@ validate_re($one,$two,"The $puppetversion fact does not match 2.7") EOS it 'validates a failed array with a custom error message' do - expect(apply_manifest(pp4, expect_failures: true).stderr).to match(%r{does not match}) + expect(apply_manifest(pp4, :expect_failures => true).stderr).to match(%r{does not match}) end end diff --git a/spec/acceptance/validate_slength_spec.rb b/spec/acceptance/validate_slength_spec.rb index a661a21fa..0a1908e86 100755 --- a/spec/acceptance/validate_slength_spec.rb +++ b/spec/acceptance/validate_slength_spec.rb @@ -9,7 +9,7 @@ validate_slength($one,$two) EOS it 'validates a single string max' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-EOS @@ -18,7 +18,7 @@ validate_slength($one,$two) EOS it 'validates multiple string maxes' do - apply_manifest(pp2, catch_failures: true) + apply_manifest(pp2, :catch_failures => true) end pp3 = <<-EOS @@ -28,7 +28,7 @@ validate_slength($one,$two,$three) EOS it 'validates min/max of strings in array' do - apply_manifest(pp3, catch_failures: true) + apply_manifest(pp3, :catch_failures => true) end pp4 = <<-EOS @@ -37,7 +37,7 @@ validate_slength($one,$two) EOS it 'validates a single string max of incorrect length' do - apply_manifest(pp4, expect_failures: true) + apply_manifest(pp4, :expect_failures => true) end pp5 = <<-EOS @@ -46,7 +46,7 @@ validate_slength($one,$two) EOS it 'validates multiple string maxes of incorrect length' do - apply_manifest(pp5, expect_failures: true) + apply_manifest(pp5, :expect_failures => true) end pp6 = <<-EOS @@ -56,7 +56,7 @@ validate_slength($one,$two,$three) EOS it 'validates multiple strings min/maxes of incorrect length' do - apply_manifest(pp6, expect_failures: true) + apply_manifest(pp6, :expect_failures => true) end end describe 'failure' do diff --git a/spec/acceptance/validate_string_spec.rb b/spec/acceptance/validate_string_spec.rb index 3d4629ca0..3323925d7 100755 --- a/spec/acceptance/validate_string_spec.rb +++ b/spec/acceptance/validate_string_spec.rb @@ -8,7 +8,7 @@ validate_string($one) EOS it 'validates a single argument' do - apply_manifest(pp1, catch_failures: true) + apply_manifest(pp1, :catch_failures => true) end pp2 = <<-EOS @@ -17,14 +17,14 @@ validate_string($one,$two) EOS it 'validates an multiple arguments' do - apply_manifest(pp2, catch_failures: true) + apply_manifest(pp2, :catch_failures => true) end pp3 = <<-EOS validate_string(undef) EOS it 'validates undef' do - apply_manifest(pp3, catch_failures: true) + apply_manifest(pp3, :catch_failures => true) end { @@ -33,7 +33,7 @@ %{validate_string(false)} => 'FalseClass', }.each do |pp4, type| it "validates a non-string: #{pp4.inspect}" do - expect(apply_manifest(pp4, expect_failures: true).stderr).to match(%r{a #{type}}) + expect(apply_manifest(pp4, :expect_failures => true).stderr).to match(%r{a #{type}}) end end end diff --git a/spec/acceptance/values_at_spec.rb b/spec/acceptance/values_at_spec.rb index fa443c35e..83d84d1e7 100755 --- a/spec/acceptance/values_at_spec.rb +++ b/spec/acceptance/values_at_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'returns a specific value' do - expect(apply_manifest(pp1, catch_failures: true).stdout).to match(%r{\["b"\]}) + expect(apply_manifest(pp1, :catch_failures => true).stdout).to match(%r{\["b"\]}) end pp2 = <<-EOS @@ -21,7 +21,7 @@ EOS it 'returns a specific negative index value' do pending("negative numbers don't work") - expect(apply_manifest(pp2, catch_failures: true).stdout).to match(%r{\["e"\]}) + expect(apply_manifest(pp2, :catch_failures => true).stdout).to match(%r{\["e"\]}) end pp3 = <<-EOS @@ -31,7 +31,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'returns a range of values' do - expect(apply_manifest(pp3, catch_failures: true).stdout).to match(%r{\["b", "c", "d"\]}) + expect(apply_manifest(pp3, :catch_failures => true).stdout).to match(%r{\["b", "c", "d"\]}) end pp4 = <<-EOS @@ -41,7 +41,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'returns a negative specific value and range of values' do - expect(apply_manifest(pp4, catch_failures: true).stdout).to match(%r{\["b", "c", "d", "a"\]}) + expect(apply_manifest(pp4, :catch_failures => true).stdout).to match(%r{\["b", "c", "d", "a"\]}) end end @@ -52,7 +52,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'handles improper number of arguments' do - expect(apply_manifest(pp5, expect_failures: true).stderr).to match(%r{Wrong number of arguments}) + expect(apply_manifest(pp5, :expect_failures => true).stderr).to match(%r{Wrong number of arguments}) end pp6 = <<-EOS @@ -62,7 +62,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'handles non-indicies arguments' do - expect(apply_manifest(pp6, expect_failures: true).stderr).to match(%r{at least one positive index}) + expect(apply_manifest(pp6, :expect_failures => true).stderr).to match(%r{at least one positive index}) end it 'detects index ranges smaller than the start range' diff --git a/spec/acceptance/values_spec.rb b/spec/acceptance/values_spec.rb index 47c4ecfda..fedd735dc 100755 --- a/spec/acceptance/values_spec.rb +++ b/spec/acceptance/values_spec.rb @@ -13,7 +13,7 @@ notice(inline_template('<%= @output.sort.inspect %>')) EOS it 'returns an array of values' do - expect(apply_manifest(pp1, catch_failures: true).stdout).to match(%r{\[1, 2, 3\]}) + expect(apply_manifest(pp1, :catch_failures => true).stdout).to match(%r{\[1, 2, 3\]}) end end @@ -24,7 +24,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'handles non-hash arguments' do - expect(apply_manifest(pp2, expect_failures: true).stderr).to match(%r{Requires hash}) + expect(apply_manifest(pp2, :expect_failures => true).stderr).to match(%r{Requires hash}) end end end diff --git a/spec/acceptance/zip_spec.rb b/spec/acceptance/zip_spec.rb index a48b0a8e5..e0f4f3f5a 100755 --- a/spec/acceptance/zip_spec.rb +++ b/spec/acceptance/zip_spec.rb @@ -10,7 +10,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'zips two arrays of numbers together' do - expect(apply_manifest(pp1, catch_failures: true).stdout).to match(%r{\[\[1, 5\], \[2, 6\], \[3, 7\], \[4, 8\]\]}) + expect(apply_manifest(pp1, :catch_failures => true).stdout).to match(%r{\[\[1, 5\], \[2, 6\], \[3, 7\], \[4, 8\]\]}) end pp2 = <<-EOS @@ -20,7 +20,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'zips two arrays of numbers & bools together' do - expect(apply_manifest(pp2, catch_failures: true).stdout).to match(%r{\[\[1, true\], \[2, true\], \["three", false\], \[4, false\]\]}) + expect(apply_manifest(pp2, :catch_failures => true).stdout).to match(%r{\[\[1, true\], \[2, true\], \["three", false\], \[4, false\]\]}) end # XXX This only tests the argument `true`, even though the following are valid: @@ -34,7 +34,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'zips two arrays of numbers together and flattens them' do - expect(apply_manifest(pp3, catch_failures: true).stdout).to match(%r{\[1, 5, 2, 6, 3, 7, 4, 8\]}) + expect(apply_manifest(pp3, :catch_failures => true).stdout).to match(%r{\[1, 5, 2, 6, 3, 7, 4, 8\]}) end # XXX Is this expected behavior? @@ -45,7 +45,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'handles unmatched length' do - expect(apply_manifest(pp4, catch_failures: true).stdout).to match(%r{\[\[1, 5\], \[2, 6\]\]}) + expect(apply_manifest(pp4, :catch_failures => true).stdout).to match(%r{\[\[1, 5\], \[2, 6\]\]}) end end @@ -56,7 +56,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'handles improper number of arguments' do - expect(apply_manifest(pp5, expect_failures: true).stderr).to match(%r{Wrong number of arguments}) + expect(apply_manifest(pp5, :expect_failures => true).stderr).to match(%r{Wrong number of arguments}) end pp6 = <<-EOS @@ -66,7 +66,7 @@ notice(inline_template('<%= @output.inspect %>')) EOS it 'handles improper argument types' do - expect(apply_manifest(pp6, expect_failures: true).stderr).to match(%r{Requires array}) + expect(apply_manifest(pp6, :expect_failures => true).stderr).to match(%r{Requires array}) end end end diff --git a/spec/functions/abs_spec.rb b/spec/functions/abs_spec.rb index 41c2650ae..a151a7e93 100755 --- a/spec/functions/abs_spec.rb +++ b/spec/functions/abs_spec.rb @@ -3,7 +3,7 @@ describe 'abs' do it { is_expected.not_to eq(nil) } - describe 'signature validation in puppet3', unless: RSpec.configuration.puppet_future do + describe 'signature validation in puppet3', :unless => RSpec.configuration.puppet_future do it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } it { pending('Current implementation ignores parameters after the first.') @@ -11,7 +11,7 @@ } end - describe 'signature validation in puppet4', if: RSpec.configuration.puppet_future do + describe 'signature validation in puppet4', :if => RSpec.configuration.puppet_future do it { pending 'the puppet 4 implementation' is_expected.to run.with_params.and_raise_error(ArgumentError) diff --git a/spec/functions/any2bool_spec.rb b/spec/functions/any2bool_spec.rb index e4d0482ab..eaead8f9f 100755 --- a/spec/functions/any2bool_spec.rb +++ b/spec/functions/any2bool_spec.rb @@ -34,7 +34,7 @@ end describe 'everything else returns true' do - [[], {}, ['1'], [1], { one: 1 }].each do |value| + [[], {}, ['1'], [1], { :one => 1 }].each do |value| it { is_expected.to run.with_params(value).and_return(true) } end end diff --git a/spec/functions/fqdn_rand_string_spec.rb b/spec/functions/fqdn_rand_string_spec.rb index 425fe9d44..ed6e376c2 100644 --- a/spec/functions/fqdn_rand_string_spec.rb +++ b/spec/functions/fqdn_rand_string_spec.rb @@ -28,22 +28,22 @@ end it 'considers the same host and same extra arguments to have the same random sequence' do - first_random = fqdn_rand_string(10, extra_identifier: [1, 'same', 'host']) - second_random = fqdn_rand_string(10, extra_identifier: [1, 'same', 'host']) + first_random = fqdn_rand_string(10, :extra_identifier => [1, 'same', 'host']) + second_random = fqdn_rand_string(10, :extra_identifier => [1, 'same', 'host']) expect(first_random).to eql(second_random) end it 'allows extra arguments to control the random value on a single host' do - first_random = fqdn_rand_string(10, extra_identifier: [1, 'different', 'host']) - second_different_random = fqdn_rand_string(10, extra_identifier: [2, 'different', 'host']) + first_random = fqdn_rand_string(10, :extra_identifier => [1, 'different', 'host']) + second_different_random = fqdn_rand_string(10, :extra_identifier => [2, 'different', 'host']) expect(first_random).not_to eql(second_different_random) end it 'returns different strings for different hosts' do - val1 = fqdn_rand_string(10, host: 'first.host.com') - val2 = fqdn_rand_string(10, host: 'second.host.com') + val1 = fqdn_rand_string(10, :host => 'first.host.com') + val2 = fqdn_rand_string(10, :host => 'second.host.com') expect(val1).not_to eql(val2) end diff --git a/spec/functions/fqdn_rotate_spec.rb b/spec/functions/fqdn_rotate_spec.rb index 8168b8d40..93e0bbaab 100755 --- a/spec/functions/fqdn_rotate_spec.rb +++ b/spec/functions/fqdn_rotate_spec.rb @@ -17,26 +17,26 @@ end it 'rotates a string to give the same results for one host' do - val1 = fqdn_rotate('abcdefg', host: 'one') - val2 = fqdn_rotate('abcdefg', host: 'one') + val1 = fqdn_rotate('abcdefg', :host => 'one') + val2 = fqdn_rotate('abcdefg', :host => 'one') expect(val1).to eq(val2) end it 'allows extra arguments to control the random rotation on a single host' do - val1 = fqdn_rotate('abcdefg', extra_identifier: [1, 'different', 'host']) - val2 = fqdn_rotate('abcdefg', extra_identifier: [2, 'different', 'host']) + val1 = fqdn_rotate('abcdefg', :extra_identifier => [1, 'different', 'host']) + val2 = fqdn_rotate('abcdefg', :extra_identifier => [2, 'different', 'host']) expect(val1).not_to eq(val2) end it 'considers the same host and same extra arguments to have the same random rotation' do - val1 = fqdn_rotate('abcdefg', extra_identifier: [1, 'same', 'host']) - val2 = fqdn_rotate('abcdefg', extra_identifier: [1, 'same', 'host']) + val1 = fqdn_rotate('abcdefg', :extra_identifier => [1, 'same', 'host']) + val2 = fqdn_rotate('abcdefg', :extra_identifier => [1, 'same', 'host']) expect(val1).to eq(val2) end it 'rotates a string to give different values on different hosts' do - val1 = fqdn_rotate('abcdefg', host: 'one') - val2 = fqdn_rotate('abcdefg', host: 'two') + val1 = fqdn_rotate('abcdefg', :host => 'one') + val2 = fqdn_rotate('abcdefg', :host => 'two') expect(val1).not_to eq(val2) end diff --git a/spec/functions/has_interface_with_spec.rb b/spec/functions/has_interface_with_spec.rb index 33ff9d942..a648aa0ac 100755 --- a/spec/functions/has_interface_with_spec.rb +++ b/spec/functions/has_interface_with_spec.rb @@ -8,7 +8,7 @@ # We need to mock out the Facts so we can specify how we expect this function # to behave on different platforms. context 'On Mac OS X Systems' do - let(:facts) { { interfaces: 'lo0,gif0,stf0,en1,p2p0,fw0,en0,vmnet1,vmnet8,utun0' } } + let(:facts) { { :interfaces => 'lo0,gif0,stf0,en1,p2p0,fw0,en0,vmnet1,vmnet8,utun0' } } it { is_expected.to run.with_params('lo0').and_return(true) } it { is_expected.to run.with_params('lo').and_return(false) } @@ -17,13 +17,13 @@ context 'On Linux Systems' do let(:facts) do { - interfaces: 'eth0,lo', - ipaddress: '10.0.0.1', - ipaddress_lo: '127.0.0.1', - ipaddress_eth0: '10.0.0.1', - muppet: 'kermit', - muppet_lo: 'mspiggy', - muppet_eth0: 'kermit', + :interfaces => 'eth0,lo', + :ipaddress => '10.0.0.1', + :ipaddress_lo => '127.0.0.1', + :ipaddress_eth0 => '10.0.0.1', + :muppet => 'kermit', + :muppet_lo => 'mspiggy', + :muppet_eth0 => 'kermit', } end diff --git a/spec/functions/has_ip_address_spec.rb b/spec/functions/has_ip_address_spec.rb index 77ca1e2ba..935214373 100755 --- a/spec/functions/has_ip_address_spec.rb +++ b/spec/functions/has_ip_address_spec.rb @@ -8,10 +8,10 @@ context 'On Linux Systems' do let(:facts) do { - interfaces: 'eth0,lo', - ipaddress: '10.0.0.1', - ipaddress_lo: '127.0.0.1', - ipaddress_eth0: '10.0.0.1', + :interfaces => 'eth0,lo', + :ipaddress => '10.0.0.1', + :ipaddress_lo => '127.0.0.1', + :ipaddress_eth0 => '10.0.0.1', } end diff --git a/spec/functions/has_ip_network_spec.rb b/spec/functions/has_ip_network_spec.rb index 3881132b2..a10513eea 100755 --- a/spec/functions/has_ip_network_spec.rb +++ b/spec/functions/has_ip_network_spec.rb @@ -8,9 +8,9 @@ context 'On Linux Systems' do let(:facts) do { - interfaces: 'eth0,lo', - network_lo: '127.0.0.0', - network_eth0: '10.0.0.0', + :interfaces => 'eth0,lo', + :network_lo => '127.0.0.0', + :network_eth0 => '10.0.0.0', } end diff --git a/spec/functions/is_ip_address_spec.rb b/spec/functions/is_ip_address_spec.rb index d7163897d..1c05726ac 100755 --- a/spec/functions/is_ip_address_spec.rb +++ b/spec/functions/is_ip_address_spec.rb @@ -21,7 +21,7 @@ it { is_expected.to run.with_params({}).and_return(false) } it { is_expected.to run.with_params([]).and_return(false) } - context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do + context 'Checking for deprecation warning', :if => Puppet.version.to_f < 4.0 do # Checking for deprecation warning, which should only be provoked when the env variable for it is set. it 'displays a single deprecation' do ENV['STDLIB_LOG_DEPRECATIONS'] = 'true' diff --git a/spec/functions/is_ipv4_address_spec.rb b/spec/functions/is_ipv4_address_spec.rb index 20d29cb7c..fdc2206dc 100644 --- a/spec/functions/is_ipv4_address_spec.rb +++ b/spec/functions/is_ipv4_address_spec.rb @@ -12,7 +12,7 @@ it { is_expected.to run.with_params(value).and_return(false) } end - context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do + context 'Checking for deprecation warning', :if => Puppet.version.to_f < 4.0 do after(:each) do ENV.delete('STDLIB_LOG_DEPRECATIONS') end diff --git a/spec/functions/is_ipv6_address_spec.rb b/spec/functions/is_ipv6_address_spec.rb index 09246a181..d85bef322 100644 --- a/spec/functions/is_ipv6_address_spec.rb +++ b/spec/functions/is_ipv6_address_spec.rb @@ -10,7 +10,7 @@ it { is_expected.to run.with_params('').and_return(false) } it { is_expected.to run.with_params('one').and_return(false) } - context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do + context 'Checking for deprecation warning', :if => Puppet.version.to_f < 4.0 do after(:each) do ENV.delete('STDLIB_LOG_DEPRECATIONS') end diff --git a/spec/functions/load_module_metadata_spec.rb b/spec/functions/load_module_metadata_spec.rb index 21362c360..eb9a94bd0 100755 --- a/spec/functions/load_module_metadata_spec.rb +++ b/spec/functions/load_module_metadata_spec.rb @@ -7,13 +7,13 @@ describe 'when calling with valid arguments' do before :each do - allow(File).to receive(:read).with(%r{\/(stdlib|test)\/metadata.json}, encoding: 'utf-8').and_return('{"name": "puppetlabs-stdlib"}') + allow(File).to receive(:read).with(%r{\/(stdlib|test)\/metadata.json}, :encoding => 'utf-8').and_return('{"name": "puppetlabs-stdlib"}') allow(File).to receive(:read).with(%r{\/(stdlib|test)\/metadata.json}).and_return('{"name": "puppetlabs-stdlib"}') end context 'when calling with valid utf8 and double byte character arguments' do before :each do - allow(File).to receive(:read).with(%r{\/(stdlib|test)\/metadata.json}, encoding: 'utf-8').and_return('{"ĭďèʼnţĩƒіểя": "ċơņťęאּť ỡƒ ţħíš - + allow(File).to receive(:read).with(%r{\/(stdlib|test)\/metadata.json}, :encoding => 'utf-8').and_return('{"ĭďèʼnţĩƒіểя": "ċơņťęאּť ỡƒ ţħíš - この文字"}') allow(File).to receive(:read).with(%r{\/(stdlib|test)\/metadata.json}).and_return('{"ĭďèʼnţĩƒіểя": "ċơņťęאּť ỡƒ ţħíš - この文字"}') diff --git a/spec/functions/loadjson_spec.rb b/spec/functions/loadjson_spec.rb index c2416f356..fc4d97d6a 100644 --- a/spec/functions/loadjson_spec.rb +++ b/spec/functions/loadjson_spec.rb @@ -6,7 +6,7 @@ describe 'when calling with valid arguments' do before :each do - allow(File).to receive(:read).with(%r{\/(stdlib|test)\/metadata.json}, encoding: 'utf-8').and_return('{"name": "puppetlabs-stdlib"}') + allow(File).to receive(:read).with(%r{\/(stdlib|test)\/metadata.json}, :encoding => 'utf-8').and_return('{"name": "puppetlabs-stdlib"}') allow(File).to receive(:read).with(%r{\/(stdlib|test)\/metadata.json}).and_return('{"name": "puppetlabs-stdlib"}') end diff --git a/spec/functions/parseyaml_spec.rb b/spec/functions/parseyaml_spec.rb index 7ff6b2056..bcf0afdca 100755 --- a/spec/functions/parseyaml_spec.rb +++ b/spec/functions/parseyaml_spec.rb @@ -44,14 +44,14 @@ end end - context 'on a modern ruby', unless: RUBY_VERSION == '1.8.7' do + context 'on a modern ruby', :unless => RUBY_VERSION == '1.8.7' do it 'raises an error with invalid YAML and no default' do is_expected.to run.with_params('["one"') .and_raise_error(Psych::SyntaxError) end end - context 'when running on ruby 1.8.7, which does not have Psych', if: RUBY_VERSION == '1.8.7' do + context 'when running on ruby 1.8.7, which does not have Psych', :if => RUBY_VERSION == '1.8.7' do it 'raises an error with invalid YAML and no default' do is_expected.to run.with_params('["one"') .and_raise_error(ArgumentError) @@ -71,7 +71,7 @@ end end - context 'when running on modern rubies', unless: RUBY_VERSION == '1.8.7' do + context 'when running on modern rubies', :unless => RUBY_VERSION == '1.8.7' do ['---', '...', '*8', ''].each do |value| it "should return the default value for an incorrect #{value.inspect} string parameter" do is_expected.to run.with_params(value, 'default_value') diff --git a/spec/functions/range_spec.rb b/spec/functions/range_spec.rb index 66dfd8166..1ae4adb1f 100755 --- a/spec/functions/range_spec.rb +++ b/spec/functions/range_spec.rb @@ -3,7 +3,7 @@ describe 'range' do it { is_expected.not_to eq(nil) } - describe 'signature validation in puppet3', unless: RSpec.configuration.puppet_future do + describe 'signature validation in puppet3', :unless => RSpec.configuration.puppet_future do it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } it { pending('Current implementation ignores parameters after the third.') @@ -13,7 +13,7 @@ it { is_expected.to run.with_params('').and_raise_error(Puppet::ParseError, %r{Unknown range format}i) } end - describe 'signature validation in puppet4', if: RSpec.configuration.puppet_future do + describe 'signature validation in puppet4', :if => RSpec.configuration.puppet_future do it { pending 'the puppet 4 implementation' is_expected.to run.with_params.and_raise_error(ArgumentError) diff --git a/spec/functions/seeded_rand_spec.rb b/spec/functions/seeded_rand_spec.rb index 79daeec01..206726299 100644 --- a/spec/functions/seeded_rand_spec.rb +++ b/spec/functions/seeded_rand_spec.rb @@ -35,8 +35,8 @@ end it 'does not return different values for different hosts' do - val1 = seeded_rand(1000, 'foo', host: 'first.host.com') - val2 = seeded_rand(1000, 'foo', host: 'second.host.com') + val1 = seeded_rand(1000, 'foo', :host => 'first.host.com') + val2 = seeded_rand(1000, 'foo', :host => 'second.host.com') expect(val1).to eql(val2) end diff --git a/spec/functions/validate_cmd_spec.rb b/spec/functions/validate_cmd_spec.rb index 589846f16..91fd0d192 100755 --- a/spec/functions/validate_cmd_spec.rb +++ b/spec/functions/validate_cmd_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'validate_cmd', unless: Puppet::Util::Platform.windows? do +describe 'validate_cmd', :unless => Puppet::Util::Platform.windows? do let(:touch) { File.exist?('/usr/bin/touch') ? '/usr/bin/touch' : '/bin/touch' } describe 'signature validation' do diff --git a/spec/functions/validate_integer_spec.rb b/spec/functions/validate_integer_spec.rb index 01bff7af1..4792d9555 100755 --- a/spec/functions/validate_integer_spec.rb +++ b/spec/functions/validate_integer_spec.rb @@ -24,11 +24,11 @@ it { is_expected.to run.with_params([0, 1, 2, invalid, 3, 4], 10, -10).and_raise_error(Puppet::ParseError, %r{to be an Integer}) } end - context 'when running on modern rubies', unless: RUBY_VERSION == '1.8.7' do + context 'when running on modern rubies', :unless => RUBY_VERSION == '1.8.7' do it { is_expected.to run.with_params([0, 1, 2, { 1 => 2 }, 3, 4], 10, -10).and_raise_error(Puppet::ParseError, %r{to be an Integer}) } end - context 'when running on ruby, which munges hashes weirdly', if: RUBY_VERSION == '1.8.7' do + context 'when running on ruby, which munges hashes weirdly', :if => RUBY_VERSION == '1.8.7' do it { is_expected.to run.with_params([0, 1, 2, { 1 => 2 }, 3, 4], 10, -10).and_raise_error(Puppet::ParseError) } it { is_expected.to run.with_params([0, 1, 2, { 0 => 2 }, 3, 4], 10, -10).and_raise_error(Puppet::ParseError) } end diff --git a/spec/functions/validate_ip_address_spec.rb b/spec/functions/validate_ip_address_spec.rb index d4182db91..714f7b247 100644 --- a/spec/functions/validate_ip_address_spec.rb +++ b/spec/functions/validate_ip_address_spec.rb @@ -20,7 +20,7 @@ it { is_expected.to run.with_params('::1/64') } it { is_expected.to run.with_params('fe80::a00:27ff:fe94:44d6/64') } - context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do + context 'Checking for deprecation warning', :if => Puppet.version.to_f < 4.0 do after(:each) do ENV.delete('STDLIB_LOG_DEPRECATIONS') end diff --git a/spec/functions/validate_ipv4_address_spec.rb b/spec/functions/validate_ipv4_address_spec.rb index eab040834..72a8018eb 100755 --- a/spec/functions/validate_ipv4_address_spec.rb +++ b/spec/functions/validate_ipv4_address_spec.rb @@ -6,7 +6,7 @@ it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } end - context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do + context 'Checking for deprecation warning', :if => Puppet.version.to_f < 4.0 do after(:each) do ENV.delete('STDLIB_LOG_DEPRECATIONS') end diff --git a/spec/functions/validate_ipv6_address_spec.rb b/spec/functions/validate_ipv6_address_spec.rb index 66fb9c6d9..5f4e31271 100755 --- a/spec/functions/validate_ipv6_address_spec.rb +++ b/spec/functions/validate_ipv6_address_spec.rb @@ -6,7 +6,7 @@ it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } end - context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do + context 'Checking for deprecation warning', :if => Puppet.version.to_f < 4.0 do after(:each) do ENV.delete('STDLIB_LOG_DEPRECATIONS') end @@ -51,7 +51,7 @@ it { is_expected.to run.with_params('::1', {}).and_raise_error(Puppet::ParseError, %r{is not a string}) } it { is_expected.to run.with_params('::1', true).and_raise_error(Puppet::ParseError, %r{is not a string}) } it { is_expected.to run.with_params('::1', 'one').and_raise_error(Puppet::ParseError, %r{is not a valid IPv6}) } - context 'unless running on ruby 1.8.7', if: RUBY_VERSION != '1.8.7' do + context 'unless running on ruby 1.8.7', :if => RUBY_VERSION != '1.8.7' do it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, %r{is not a string}) } it { is_expected.to run.with_params('::1', 1).and_raise_error(Puppet::ParseError, %r{is not a string}) } end diff --git a/spec/functions/validate_numeric_spec.rb b/spec/functions/validate_numeric_spec.rb index f9ea1c829..75217a252 100755 --- a/spec/functions/validate_numeric_spec.rb +++ b/spec/functions/validate_numeric_spec.rb @@ -23,11 +23,11 @@ it { is_expected.to run.with_params(invalid, 10.0, -10.0).and_raise_error(Puppet::ParseError, %r{to be a Numeric}) } end - context 'when running on modern rubies', unless: RUBY_VERSION == '1.8.7' do + context 'when running on modern rubies', :unless => RUBY_VERSION == '1.8.7' do it { is_expected.to run.with_params([0, 1, 2, { 1 => 2 }, 3, 4], 10, -10).and_raise_error(Puppet::ParseError, %r{to be a Numeric}) } end - context 'when running on ruby, which munges hashes weirdly', if: RUBY_VERSION == '1.8.7' do + context 'when running on ruby, which munges hashes weirdly', :if => RUBY_VERSION == '1.8.7' do it { is_expected.to run.with_params([0, 1, 2, { 1 => 2 }, 3, 4], 10, -10).and_raise_error(Puppet::ParseError) } it { is_expected.to run.with_params([0, 1, 2, { 0 => 2 }, 3, 4], 10, -10).and_raise_error(Puppet::ParseError) } end diff --git a/spec/functions/validate_re_spec.rb b/spec/functions/validate_re_spec.rb index 29297742f..84391b312 100755 --- a/spec/functions/validate_re_spec.rb +++ b/spec/functions/validate_re_spec.rb @@ -47,7 +47,7 @@ false, # FalseClass ['10'], # Array :key, # Symbol - { key: 'val' }, # Hash + { :key => 'val' }, # Hash ].each do |input| it { is_expected.to run.with_params(input, '.*').and_raise_error(Puppet::ParseError, %r{needs to be a String}) } end diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 7be1a52ad..3f117ac3e 100755 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -46,7 +46,7 @@ def return_puppet_version end after :each do - shell("rm -f '#{facts_d}/fqdn.txt'", acceptable_exit_codes: [0, 1]) + shell("rm -f '#{facts_d}/fqdn.txt'", :acceptable_exit_codes => [0, 1]) end def fake_fact(name, value) diff --git a/spec/unit/facter/package_provider_spec.rb b/spec/unit/facter/package_provider_spec.rb index f298726cb..b09284836 100644 --- a/spec/unit/facter/package_provider_spec.rb +++ b/spec/unit/facter/package_provider_spec.rb @@ -3,7 +3,7 @@ require 'puppet/type' require 'puppet/type/package' -describe 'package_provider', type: :fact do +describe 'package_provider', :type => :fact do before(:each) { Facter.clear } after(:each) { Facter.clear } diff --git a/spec/unit/facter/root_home_spec.rb b/spec/unit/facter/root_home_spec.rb index d45db75f3..d9d2c0fdb 100755 --- a/spec/unit/facter/root_home_spec.rb +++ b/spec/unit/facter/root_home_spec.rb @@ -31,7 +31,7 @@ end end - describe 'root_home', type: :fact do + describe 'root_home', :type => :fact do before(:each) { Facter.clear } after(:each) { Facter.clear } diff --git a/spec/unit/facter/service_provider_spec.rb b/spec/unit/facter/service_provider_spec.rb index 7acece215..f59b8d8ab 100644 --- a/spec/unit/facter/service_provider_spec.rb +++ b/spec/unit/facter/service_provider_spec.rb @@ -3,7 +3,7 @@ require 'puppet/type' require 'puppet/type/service' -describe 'service_provider', type: :fact do +describe 'service_provider', :type => :fact do before(:each) { Facter.clear } after(:each) { Facter.clear } diff --git a/spec/unit/puppet/provider/file_line/ruby_spec.rb b/spec/unit/puppet/provider/file_line/ruby_spec.rb index 2fb27b19c..2daab34b5 100755 --- a/spec/unit/puppet/provider/file_line/ruby_spec.rb +++ b/spec/unit/puppet/provider/file_line/ruby_spec.rb @@ -3,7 +3,7 @@ provider_class = Puppet::Type.type(:file_line).provider(:ruby) #  These tests fail on windows when run as part of the rake task. Individually they pass -describe provider_class, unless: Puppet::Util::Platform.windows? do +describe provider_class, :unless => Puppet::Util::Platform.windows? do include PuppetlabsSpec::Files let :tmpfile do @@ -17,9 +17,9 @@ end let :resource do Puppet::Type::File_line.new({ - name: 'foo', - path: tmpfile, - line: 'foo', + :name => 'foo', + :path => tmpfile, + :line => 'foo', }.merge(params)) end let :provider do @@ -54,7 +54,7 @@ end describe 'match parameter' do - let(:params) { { match: '^bar' } } + let(:params) { { :match => '^bar' } } describe 'does not match line - line does not exist - replacing' do let(:content) { "foo bar\nbar" } @@ -69,7 +69,7 @@ end describe 'does not match line - line does not exist - appending' do - let(:params) { super().merge(replace: false) } + let(:params) { super().merge(:replace => false) } let(:content) { "foo bar\nbar" } it 'does not request changes' do @@ -86,7 +86,7 @@ end context 'matches line - line exists' do - let(:params) { { match: '^foo' } } + let(:params) { { :match => '^foo' } } let(:content) { "foo\nbar" } it 'detects the line' do @@ -95,7 +95,7 @@ end context 'matches line - line does not exist' do - let(:params) { { match: '^foo' } } + let(:params) { { :match => '^foo' } } let(:content) { "foo bar\nbar" } it 'requests changes' do @@ -111,8 +111,8 @@ describe 'append_on_no_match' do let(:params) do { - append_on_no_match: false, - match: '^foo1$', + :append_on_no_match => false, + :match => '^foo1$', } end @@ -140,8 +140,8 @@ context 'when replace is false' do let(:params) do { - replace_all_matches_not_matching_line: true, - replace: false, + :replace_all_matches_not_matching_line => true, + :replace => false, } end @@ -153,9 +153,9 @@ context 'when match matches line - when there are more matches than lines' do let(:params) do { - replace_all_matches_not_matching_line: true, - match: '^foo', - multiple: true, + :replace_all_matches_not_matching_line => true, + :match => '^foo', + :multiple => true, } end let(:content) { "foo\nfoo bar\nbar\nfoo baz" } @@ -172,9 +172,9 @@ context 'when match matches line - when there are the same matches and lines' do let(:params) do { - replace_all_matches_not_matching_line: true, - match: '^foo', - multiple: true, + :replace_all_matches_not_matching_line => true, + :match => '^foo', + :multiple => true, } end let(:content) { "foo\nfoo\nbar" } @@ -187,9 +187,9 @@ context 'when match does not match line - when there are more matches than lines' do let(:params) do { - replace_all_matches_not_matching_line: true, - match: '^bar', - multiple: true, + :replace_all_matches_not_matching_line => true, + :match => '^bar', + :multiple => true, } end let(:content) { "foo\nfoo bar\nbar\nbar baz" } @@ -206,9 +206,9 @@ context 'when match does not match line - when there are the same matches and lines' do let(:params) do { - replace_all_matches_not_matching_line: true, - match: '^bar', - multiple: true, + :replace_all_matches_not_matching_line => true, + :match => '^bar', + :multiple => true, } end let(:content) { "foo\nfoo\nbar\nbar baz" } @@ -226,9 +226,9 @@ context 'when match does not match line - when there are no matches' do let(:params) do { - replace_all_matches_not_matching_line: true, - match: '^bar', - multiple: true, + :replace_all_matches_not_matching_line => true, + :match => '^bar', + :multiple => true, } end let(:content) { "foo\nfoo bar" } @@ -241,9 +241,9 @@ context 'when match does not match line - when there are no matches or lines' do let(:params) do { - replace_all_matches_not_matching_line: true, - match: '^bar', - multiple: true, + :replace_all_matches_not_matching_line => true, + :match => '^bar', + :multiple => true, } end let(:content) { 'foo bar' } diff --git a/spec/unit/puppet/provider/file_line/ruby_spec_alter.rb b/spec/unit/puppet/provider/file_line/ruby_spec_alter.rb index e9b7541c7..316c5c080 100755 --- a/spec/unit/puppet/provider/file_line/ruby_spec_alter.rb +++ b/spec/unit/puppet/provider/file_line/ruby_spec_alter.rb @@ -3,7 +3,7 @@ provider_class = Puppet::Type.type(:file_line).provider(:ruby) #  These tests fail on windows when run as part of the rake task. Individually they pass -describe provider_class, unless: Puppet::Util::Platform.windows? do +describe provider_class, :unless => Puppet::Util::Platform.windows? do include PuppetlabsSpec::Files let :tmpfile do @@ -17,9 +17,9 @@ end let :resource do Puppet::Type::File_line.new({ - name: 'foo', - path: tmpfile, - line: 'foo', + :name => 'foo', + :path => tmpfile, + :line => 'foo', }.merge(params)) end let :provider do @@ -39,9 +39,9 @@ context 'when replacing' do let :params do { - line: 'foo = bar', - match: '^foo\s*=.*$', - replace: false, + :line => 'foo = bar', + :match => '^foo\s*=.*$', + :replace => false, } end let(:content) { "foo1\nfoo=blah\nfoo2\nfoo3" } @@ -62,7 +62,7 @@ it 'raises an error with invalid values' do expect { @resource = Puppet::Type::File_line.new( - name: 'foo', path: tmpfile, line: 'foo = bar', match: '^foo\s*=.*$', replace: 'asgadga', + :name => 'foo', :path => tmpfile, :line => 'foo = bar', :match => '^foo\s*=.*$', :replace => 'asgadga', ) }.to raise_error(Puppet::Error, %r{Invalid value "asgadga"\. Valid values are true, false\.}) end @@ -75,10 +75,10 @@ # rubocop:disable RSpec/InstanceVariable : replacing before with let breaks the tests, variables need to be altered within it block : multi before :each do @resource = Puppet::Type::File_line.new( - name: 'foo', - path: tmpfile, - line: 'foo = bar', - match: '^foo\s*=.*$', + :name => 'foo', + :path => tmpfile, + :line => 'foo = bar', + :match => '^foo\s*=.*$', ) @provider = provider_class.new(@resource) end @@ -90,7 +90,7 @@ end it 'replaces all lines that matches' do - @resource = Puppet::Type::File_line.new(name: 'foo', path: tmpfile, line: 'foo = bar', match: '^foo\s*=.*$', multiple: true) + @resource = Puppet::Type::File_line.new(:name => 'foo', :path => tmpfile, :line => 'foo = bar', :match => '^foo\s*=.*$', :multiple => true) @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo=blah\nfoo2\nfoo=baz") } @provider.create @@ -98,7 +98,7 @@ end it 'replaces all lines that match, even when some lines are correct' do - @resource = Puppet::Type::File_line.new(name: 'neil', path: tmpfile, line: "\thard\tcore\t0\n", match: '^[ \t]hard[ \t]+core[ \t]+.*', multiple: true) + @resource = Puppet::Type::File_line.new(:name => 'neil', :path => tmpfile, :line => "\thard\tcore\t0\n", :match => '^[ \t]hard[ \t]+core[ \t]+.*', :multiple => true) @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("\thard\tcore\t90\n\thard\tcore\t0\n") } @provider.create @@ -108,7 +108,7 @@ it 'raises an error with invalid values' do expect { @resource = Puppet::Type::File_line.new( - name: 'foo', path: tmpfile, line: 'foo = bar', match: '^foo\s*=.*$', multiple: 'asgadga', + :name => 'foo', :path => tmpfile, :line => 'foo = bar', :match => '^foo\s*=.*$', :multiple => 'asgadga', ) }.to raise_error(Puppet::Error, %r{Invalid value "asgadga"\. Valid values are true, false\.}) end @@ -131,7 +131,7 @@ end describe 'using match+append_on_no_match - when there is a match' do it 'replaces line' do - @resource = Puppet::Type::File_line.new(name: 'foo', path: tmpfile, line: 'inserted = line', match: '^foo3$', append_on_no_match: false) + @resource = Puppet::Type::File_line.new(:name => 'foo', :path => tmpfile, :line => 'inserted = line', :match => '^foo3$', :append_on_no_match => false) @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo = blah\nfoo2\nfoo = baz") } expect(File.read(tmpfile).chomp).to eql("foo1\nfoo = blah\nfoo2\nfoo = baz") @@ -139,7 +139,7 @@ end describe 'using match+append_on_no_match - when there is no match' do it 'does not add line after no matches found' do - @resource = Puppet::Type::File_line.new(name: 'foo', path: tmpfile, line: 'inserted = line', match: '^foo3$', append_on_no_match: false) + @resource = Puppet::Type::File_line.new(:name => 'foo', :path => tmpfile, :line => 'inserted = line', :match => '^foo3$', :append_on_no_match => false) @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo = blah\nfoo2\nfoo = baz") } expect(File.read(tmpfile).chomp).to eql("foo1\nfoo = blah\nfoo2\nfoo = baz") @@ -152,10 +152,10 @@ context 'when after' do let :resource do Puppet::Type::File_line.new( - name: 'foo', - path: tmpfile, - line: 'inserted = line', - after: '^foo1', + :name => 'foo', + :path => tmpfile, + :line => 'inserted = line', + :after => '^foo1', ) end @@ -169,11 +169,11 @@ let(:after) { '^foo1$' } let(:resource) do Puppet::Type::File_line.new( - name: 'foo', - path: tmpfile, - line: 'inserted = line', - after: after, - match: match, + :name => 'foo', + :path => tmpfile, + :line => 'inserted = line', + :after => after, + :match => match, ) end end @@ -228,7 +228,7 @@ end it 'adds the line after all lines matching the after expression' do - @resource = Puppet::Type::File_line.new(name: 'foo', path: tmpfile, line: 'inserted = line', after: '^foo1$', multiple: true) + @resource = Puppet::Type::File_line.new(:name => 'foo', :path => tmpfile, :line => 'inserted = line', :after => '^foo1$', :multiple => true) @provider = provider_class.new(@resource) @provider.create expect(File.read(tmpfile).chomp).to eql("foo1\ninserted = line\nfoo = blah\nfoo2\nfoo1\ninserted = line\nfoo = baz") @@ -255,10 +255,10 @@ # file fixtures once the following pull request has been merged: # https://github.com/puppetlabs/puppetlabs-stdlib/pull/73/files @resource = Puppet::Type::File_line.new( - name: 'foo', - path: tmpfile, - line: 'foo', - ensure: 'absent', + :name => 'foo', + :path => tmpfile, + :line => 'foo', + :ensure => 'absent', ) @provider = provider_class.new(@resource) end @@ -278,7 +278,7 @@ expect(File.read(tmpfile)).to eql("foo1\nfoo2\n") end it 'example in the docs' do - @resource = Puppet::Type::File_line.new(name: 'bashrc_proxy', ensure: 'absent', path: tmpfile, line: 'export HTTP_PROXY=http://squid.puppetlabs.vm:3128') + @resource = Puppet::Type::File_line.new(:name => 'bashrc_proxy', :ensure => 'absent', :path => tmpfile, :line => 'export HTTP_PROXY=http://squid.puppetlabs.vm:3128') @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo2\nexport HTTP_PROXY=http://squid.puppetlabs.vm:3128\nfoo4\n") } @provider.destroy @@ -288,12 +288,12 @@ context 'when removing with a match' do before :each do @resource = Puppet::Type::File_line.new( - name: 'foo', - path: tmpfile, - line: 'foo2', - ensure: 'absent', - match: 'o$', - match_for_absence: true, + :name => 'foo', + :path => tmpfile, + :line => 'foo2', + :ensure => 'absent', + :match => 'o$', + :match_for_absence => true, ) @provider = provider_class.new(@resource) end @@ -310,7 +310,7 @@ end it 'the line parameter is actually not used at all but is silently ignored if here' do - @resource = Puppet::Type::File_line.new(name: 'foo', path: tmpfile, line: 'supercalifragilisticexpialidocious', ensure: 'absent', match: 'o$', match_for_absence: true) + @resource = Puppet::Type::File_line.new(:name => 'foo', :path => tmpfile, :line => 'supercalifragilisticexpialidocious', :ensure => 'absent', :match => 'o$', :match_for_absence => true) @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo\nfoo2") } @provider.destroy @@ -318,7 +318,7 @@ end it 'and may not be here and does not need to be here' do - @resource = Puppet::Type::File_line.new(name: 'foo', path: tmpfile, ensure: 'absent', match: 'o$', match_for_absence: true) + @resource = Puppet::Type::File_line.new(:name => 'foo', :path => tmpfile, :ensure => 'absent', :match => 'o$', :match_for_absence => true) @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo\nfoo2") } @provider.destroy @@ -331,7 +331,7 @@ end it 'removes multiple lines if :multiple is true' do - @resource = Puppet::Type::File_line.new(name: 'foo', path: tmpfile, line: 'foo2', ensure: 'absent', match: 'o$', multiple: true, match_for_absence: true) + @resource = Puppet::Type::File_line.new(:name => 'foo', :path => tmpfile, :line => 'foo2', :ensure => 'absent', :match => 'o$', :multiple => true, :match_for_absence => true) @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo\nfoo2\nfoo\nfoo") } @provider.destroy @@ -339,7 +339,7 @@ end it 'ignores the match if match_for_absence is not specified' do - @resource = Puppet::Type::File_line.new(name: 'foo', path: tmpfile, line: 'foo2', ensure: 'absent', match: 'o$') + @resource = Puppet::Type::File_line.new(:name => 'foo', :path => tmpfile, :line => 'foo2', :ensure => 'absent', :match => 'o$') @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo\nfoo2") } @provider.destroy @@ -347,7 +347,7 @@ end it 'ignores the match if match_for_absence is false' do - @resource = Puppet::Type::File_line.new(name: 'foo', path: tmpfile, line: 'foo2', ensure: 'absent', match: 'o$', match_for_absence: false) + @resource = Puppet::Type::File_line.new(:name => 'foo', :path => tmpfile, :line => 'foo2', :ensure => 'absent', :match => 'o$', :match_for_absence => false) @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo\nfoo2") } @provider.destroy @@ -356,8 +356,8 @@ it 'example in the docs' do # rubocop:disable RSpec/ExampleLength : Cannot reduce without violating line length rule @resource = Puppet::Type::File_line.new( - name: 'bashrc_proxy', ensure: 'absent', path: tmpfile, line: 'export HTTP_PROXY=http://squid.puppetlabs.vm:3128', - match: '^export\ HTTP_PROXY\=', match_for_absence: true + :name => 'bashrc_proxy', :ensure => 'absent', :path => tmpfile, :line => 'export HTTP_PROXY=http://squid.puppetlabs.vm:3128', + :match => '^export\ HTTP_PROXY\=', :match_for_absence => true ) @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo2\nexport HTTP_PROXY=foo\nfoo4\n") } @@ -366,7 +366,7 @@ end it 'example in the docs showing line is redundant' do - @resource = Puppet::Type::File_line.new(name: 'bashrc_proxy', ensure: 'absent', path: tmpfile, match: '^export\ HTTP_PROXY\=', match_for_absence: true) + @resource = Puppet::Type::File_line.new(:name => 'bashrc_proxy', :ensure => 'absent', :path => tmpfile, :match => '^export\ HTTP_PROXY\=', :match_for_absence => true) @provider = provider_class.new(@resource) File.open(tmpfile, 'w') { |fh| fh.write("foo1\nfoo2\nexport HTTP_PROXY=foo\nfoo4\n") } @provider.destroy diff --git a/spec/unit/puppet/provider/file_line/ruby_spec_use_cases.rb b/spec/unit/puppet/provider/file_line/ruby_spec_use_cases.rb index ed9a64ea7..19070dafd 100755 --- a/spec/unit/puppet/provider/file_line/ruby_spec_use_cases.rb +++ b/spec/unit/puppet/provider/file_line/ruby_spec_use_cases.rb @@ -3,7 +3,7 @@ provider_class = Puppet::Type.type(:file_line).provider(:ruby) #  These tests fail on windows when run as part of the rake task. Individually they pass -describe provider_class, unless: Puppet::Util::Platform.windows? do +describe provider_class, :unless => Puppet::Util::Platform.windows? do include PuppetlabsSpec::Files let :tmpfile do @@ -17,9 +17,9 @@ end let :resource do Puppet::Type::File_line.new({ - name: 'foo', - path: tmpfile, - line: 'foo', + :name => 'foo', + :path => tmpfile, + :line => 'foo', }.merge(params)) end let :provider do @@ -36,9 +36,9 @@ describe 'MODULES-5003' do let(:params) do { - line: "*\thard\tcore\t0", - match: "^[ \t]*\\*[ \t]+hard[ \t]+core[ \t]+.*", - multiple: true, + :line => "*\thard\tcore\t0", + :match => "^[ \t]*\\*[ \t]+hard[ \t]+core[ \t]+.*", + :multiple => true, } end let(:content) { "* hard core 90\n* hard core 10\n" } @@ -55,9 +55,9 @@ describe 'MODULES-5003 - one match, one line - just ensure the line exists' do let(:params) do { - line: "*\thard\tcore\t0", - match: "^[ \t]*\\*[ \t]+hard[ \t]+core[ \t]+.*", - multiple: true, + :line => "*\thard\tcore\t0", + :match => "^[ \t]*\\*[ \t]+hard[ \t]+core[ \t]+.*", + :multiple => true, } end let(:content) { "* hard core 90\n* hard core 0\n" } @@ -70,11 +70,11 @@ describe 'MODULES-5003 - one match, one line - replace all matches, even when line exists' do let(:params) do { - line: "*\thard\tcore\t0", - match: "^[ \t]*\\*[ \t]+hard[ \t]+core[ \t]+.*", - multiple: true, + :line => "*\thard\tcore\t0", + :match => "^[ \t]*\\*[ \t]+hard[ \t]+core[ \t]+.*", + :multiple => true, - }.merge(replace_all_matches_not_matching_line: true) + }.merge(:replace_all_matches_not_matching_line => true) end let(:content) { "* hard core 90\n* hard core 0\n" } @@ -90,8 +90,8 @@ describe 'MODULES-5651 - match, no line' do let(:params) do { - line: 'LogLevel=notice', - match: '^#LogLevel$', + :line => 'LogLevel=notice', + :match => '^#LogLevel$', } end let(:content) { "#LogLevel\nstuff" } @@ -108,8 +108,8 @@ describe 'MODULES-5651 - match, line' do let(:params) do { - line: 'LogLevel=notice', - match: '^#LogLevel$', + :line => 'LogLevel=notice', + :match => '^#LogLevel$', } end let(:content) { "#Loglevel\nLogLevel=notice\nstuff" } @@ -122,8 +122,8 @@ describe 'MODULES-5651 - no match, line' do let(:params) do { - line: 'LogLevel=notice', - match: '^#LogLevel$', + :line => 'LogLevel=notice', + :match => '^#LogLevel$', } end let(:content) { "LogLevel=notice\nstuff" } diff --git a/spec/unit/puppet/type/anchor_spec.rb b/spec/unit/puppet/type/anchor_spec.rb index 63cdb468a..65b109e5b 100755 --- a/spec/unit/puppet/type/anchor_spec.rb +++ b/spec/unit/puppet/type/anchor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -anchor = Puppet::Type.type(:anchor).new(name: 'ntp::begin') +anchor = Puppet::Type.type(:anchor).new(:name => 'ntp::begin') describe anchor do it 'stringifies normally' do diff --git a/spec/unit/puppet/type/file_line_spec.rb b/spec/unit/puppet/type/file_line_spec.rb index 2e742dd2e..0ae7f51f9 100755 --- a/spec/unit/puppet/type/file_line_spec.rb +++ b/spec/unit/puppet/type/file_line_spec.rb @@ -17,7 +17,7 @@ end end let :file_line do - Puppet::Type.type(:file_line).new(name: 'foo', line: 'line', path: tmp_path) + Puppet::Type.type(:file_line).new(:name => 'foo', :line => 'line', :path => tmp_path) end it 'accepts a line' do @@ -36,28 +36,28 @@ it 'accepts a match regex that does not match the specified line' do expect { Puppet::Type.type(:file_line).new( - name: 'foo', path: my_path, line: 'foo=bar', match: '^bar=blah$', + :name => 'foo', :path => my_path, :line => 'foo=bar', :match => '^bar=blah$', ) }.not_to raise_error end it 'accepts a match regex that does match the specified line' do expect { Puppet::Type.type(:file_line).new( - name: 'foo', path: my_path, line: 'foo=bar', match: '^\s*foo=.*$', + :name => 'foo', :path => my_path, :line => 'foo=bar', :match => '^\s*foo=.*$', ) }.not_to raise_error end it 'accepts utf8 characters' do expect { Puppet::Type.type(:file_line).new( - name: 'ƒồỗ', path: my_path, line: 'ƒồỗ=ьåя', match: '^ьåя=βļάħ$', + :name => 'ƒồỗ', :path => my_path, :line => 'ƒồỗ=ьåя', :match => '^ьåя=βļάħ$', ) }.not_to raise_error end it 'accepts double byte characters' do expect { Puppet::Type.type(:file_line).new( - name: 'フーバー', path: my_path, line: 'この=それ', match: '^この=ああ$', + :name => 'フーバー', :path => my_path, :line => 'この=それ', :match => '^この=ああ$', ) }.not_to raise_error end @@ -69,16 +69,16 @@ expect { file_line[:path] = 'file' }.to raise_error(Puppet::Error, %r{File paths must be fully qualified}) end it 'requires that a line is specified' do - expect { Puppet::Type.type(:file_line).new(name: 'foo', path: tmp_path) }.to raise_error(Puppet::Error, %r{line is a required attribute}) + expect { Puppet::Type.type(:file_line).new(:name => 'foo', :path => tmp_path) }.to raise_error(Puppet::Error, %r{line is a required attribute}) end it 'does not require that a line is specified when matching for absence' do - expect { Puppet::Type.type(:file_line).new(name: 'foo', path: tmp_path, ensure: :absent, match_for_absence: :true, match: 'match') }.not_to raise_error + expect { Puppet::Type.type(:file_line).new(:name => 'foo', :path => tmp_path, :ensure => :absent, :match_for_absence => :true, :match => 'match') }.not_to raise_error end it 'although if a line is specified anyway when matching for absence it still works and the line is silently ignored' do - expect { Puppet::Type.type(:file_line).new(name: 'foo', path: tmp_path, line: 'i_am_irrelevant', ensure: :absent, match_for_absence: :true, match: 'match') }.not_to raise_error + expect { Puppet::Type.type(:file_line).new(:name => 'foo', :path => tmp_path, :line => 'i_am_irrelevant', :ensure => :absent, :match_for_absence => :true, :match => 'match') }.not_to raise_error end it 'requires that a file is specified' do - expect { Puppet::Type.type(:file_line).new(name: 'foo', line: 'path') }.to raise_error(Puppet::Error, %r{path is a required attribute}) + expect { Puppet::Type.type(:file_line).new(:name => 'foo', :line => 'path') }.to raise_error(Puppet::Error, %r{path is a required attribute}) end it 'defaults to ensure => present' do expect(file_line[:ensure]).to eq :present @@ -90,12 +90,12 @@ expect(file_line[:encoding]).to eq 'UTF-8' end it 'accepts encoding => iso-8859-1' do - expect { Puppet::Type.type(:file_line).new(name: 'foo', path: tmp_path, ensure: :present, encoding: 'iso-8859-1', line: 'bar') }.not_to raise_error + expect { Puppet::Type.type(:file_line).new(:name => 'foo', :path => tmp_path, :ensure => :present, :encoding => 'iso-8859-1', :line => 'bar') }.not_to raise_error end it 'autorequires the file it manages' do # rubocop:disable RSpec/ExampleLength : example size cannot be reduced catalog = Puppet::Resource::Catalog.new - file = Puppet::Type.type(:file).new(name: tmp_path) + file = Puppet::Type.type(:file).new(:name => tmp_path) catalog.add_resource file catalog.add_resource file_line relationship = file_line.autorequire.find do |rel|