summaryrefslogtreecommitdiff
path: root/spec/unit/parameter/package_options_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2012-09-26(Maint) Remove rspec from shebang lineJeff McCune1-1/+1
Without this patch Ruby 1.9 is still complaining loudly about trying to parse the spec files. The previous attempt to clean up this problem in edc3ddf works for Ruby 1.8 but not 1.9. I'd prefer to remove the shebang lines entirely, but doing so will cause encoding errors in Ruby 1.9. This patch strives for a happy middle ground of convincing Ruby it is actually working with Ruby while not confusing it to think it should exec() to rspec. This patch is the result of the following command run against the source tree: find spec -type f -print0 | \ xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
2012-08-06(#11870) Add package options parameterJosh Cooper1-0/+44
This commit adds a new package options parameter type that accepts an array of strings or hashes. For example, [ 'arg1', { 'key2' => 'val2', 'key2' => 'val3' }, 'arg4' ] The parameter preserves the order of array elements, as it may be significant for a provider, e.g. '--source', 'URL'. Order of hash key-value pairs is based on the natural sort order of the keys. Any argument containing spaces will automatically be quoted, so that you don't have to check that in each manifest. The package options parameter is not currently used, but will be in a future commit to enable install and uninstall options to be passed to the package provider. Oddly, if any puppet parameter is specifed as an array with one element, puppet's parser-based resource will automatically de-arrify it (see commit 46252b5b). As a result, if an array is a valid value, then the validate & munge methods cannot reject an element that isn't an array. Therefore, the package options munge method arrayifies values, which has the side-efect that it will accept the 2.7.x style way of declaring install_options for MSI packages. Moreso, it means that the old way cannot be deprecated without changing core puppet behavior.