(Maint) Simplify spec test

Modified the spec test to use the `described_class` method of the
example group. Also simplified how the `resource` and `provider` were
declared in the `let` blocks.
Merge branch 'ticket/3.x/15686_s10_resource_failure' into 3.x

* ticket/3.x/15686_s10_resource_failure:
  (Maint) Simplify spec test
  (#15686) Refactor install and uninstall methods
  (#15686) Test for package provider features
  (#15686) Ensure exception message is a string
(#15686) Fix `odd number of arguments for Hash`

On ruby 1.8.5, calling `Hash[array]` raises:

  ArgumentError: odd number of arguments for Hash

This commit changes the `namemap` method to return a hash, where the
keys are the names of puppet parameters and the values are the values
obtained from the system.
(#13938) Add dedup parameter to zfs provider

This patch to the zfs type/provider:
 - adds "dedup" to the list of properties
 - removes a "vscan" property which was listed twice
 - updates the spec to list every currently supported property
Merge branch 'ticket/3.x/13938-zfs-dedup' into 3.x

* ticket/3.x/13938-zfs-dedup:
  (#13938) Add dedup parameter to zfs provider
Merge remote-tracking branch 'apenney/openbsd' into 3.x

* apenney/openbsd:
  Fix this to use .read, not .open.
  The openbsd spec tests mistakenly used File.new instead of File.open.
(#8288) pkgadd - allow -G to be specified as an install option

Before implementing this feature, pkgadd solaris could not specify {
install_options=>options } as extra options in package manifest for
puppet. This checkin adds the :install_option feature to the provider
which enables the use of { install_options=> options } parameter. This
checkin also adds the test cases for this feature.
Merge branch 'ticket/3.x/8288-pkgadd-local' into 3.x

* ticket/3.x/8288-pkgadd-local:
  (#8288) pkgadd - allow -G to be specified as an install option
(#15644) add test case to check for packages that are yet to be installed.

Added the check for latest value in the test case,
Added a new test case that checks for correct behavior in case the
package is not installed.
Merge branch '3.x'

* 3.x: (25 commits)
  (#8288) pkgadd - allow -G to be specified as an install option
  (#13938) Add dedup parameter to zfs provider
  (#15686) Fix `odd number of arguments for Hash`
  (Maint) Simplify spec test
  (#15686) Refactor install and uninstall methods
  (#15686) Test for package provider features
  (#15686) Ensure exception message is a string
  (#9416) Refactor zpool spec tests
  (#9416) Refactor zfs spec tests
  (#9416) Confine based on the presence of a `zpool` command
  (#9416) Rename zpool provider from solaris to zpool
  (#9416) Confine based on the presence of a `zfs` command
  (#9416) Rename zfs provider from solaris to zfs
  Add Puppet::Parser::Functions::clear for specs
  Clear Environment.current when calling Environment.clear
  Check that function loading worked correctly.
  Avoid stubbing Thread::new due to issues in newer mocha
  Rename specs to end in _spec.rb
  Don't require mocha in spec_helper
  Fix stubbing on nil in some specs
  ...
(#8200) validate only if we can (especially path)

The global validate block is called even when `puppet resource zone` is
called without any further arguments, so we add a check
provider.get(:ensure) != :absent to make sure that we are indeed in
zone creation stage before trying to validate. This could have been
better done by `isrequired` method in parameter.rb however this is not
hooked up now, so we are uanble to use it..

The ip validation is refactored to make it clearer to read.
(Maint) Removed unnecessary stubbing

Previously, the spec test stubbed the zone resource. This commit creates
a real resource specifying the provider to use. It also adds the type of
exception and message that we're expecting to be raised.

Paired-with: Rahul Gopinath <rahul@puppetlabs.com>
Merge branch 'ticket/3.x/8200_validate_param' into 3.x

* ticket/3.x/8200_validate_param:
  (Maint) Removed unnecessary stubbing
  (#8200) validate only if we can (especially path)
(#7175) ensure ensurable uses symbols in zone

zone provider when asked to ensure the state to running/install or any
thing tries to find the value in state_index however, state_index values
stores keys as string. This is wrong. The root cause is that
ensurable returns values as string rather than symbols. This inturn is
caused by state_name checking for string value in state_alias which is a
symbol to symbol map, and not finding any, and returning itself.
(#15644) refactor the parse_line so that it supports the newer format

Previously the parse_line conflated the different output formats of the
older and newer `pkg list` commands. This commit splits the formats to
separate regexes so that it is easier to manage. Especially if the pkg
list format changes yet again.

This commit simplifies self.instances, latest and query methods by
removing redundant lines.

Adds more comments to the methods, and changes the method names to reflect the
method usage.

Tests:
- Update the package list output so that the format is correct
(it is ufoxi - 5 dashes)

- Earlier, when a pkg list line could not be parsed, the provider warned
the user about this fact and continued. This behavior is dangerous. We
change it to fail instead.

- Added more test cases.
(#15644) ensure that pkg installation is non-interactive

Earlier, pkg install did not have --accept parameter, which means that
licenses would not be automatically accepted. Since puppet is a
non-interactive process, this is not the correct behavior. This commit
adds the --accept parameter to accept licenses during pkg installation.

Earlier, pkg uninstall added -r always to the command for recursive
uninstall. However, this was removed in the later version of the pkg
command. This commit adds the logic to check for the version before
doing `pkg uninstall -r mypkg`
Merge branch 'ticket/3.x/7175-symbolize' into 3.x

* ticket/3.x/7175-symbolize:
  (#7175) ensure ensurable uses symbols in zone
  (Maint) Removed unnecessary stubbing
  (#8200) validate only if we can (especially path)
Merge branch 'ticket/3.x/15644_fix_parse_line' into 3.x

* ticket/3.x/15644_fix_parse_line:
  (#15644) ensure that pkg installation is non-interactive
  (#15644) refactor the parse_line so that it supports the newer format
  (#15644) add test case to check for packages that are yet to be installed.
(#15920) Make forward-sexp ignore comments in puppet-mode.el

Enables parse-sexp-ignore-comments.

Previously forward-sexp was broken by comments with unterminated
strings. E.g. with the following manifest:
  foo {
    # won'
  }
forward-sexp on the opening brace would get:
  forward-sexp: Scan error: “Unbalanced parentheses”

The problem got introduced in commit
1c02749e8b54616043f728ed18ddec1dc4353a2d (Committed patch from #1160).
(#15291) Add Vendor tag to Puppet spec file

Previously the spec file had no Vendor tag, which left it undefined. This
commit adds a Vendor tag that references the _host_vendor macro, so that it can
be easily set to 'Puppet Labs' internally and customized by users easily. The
Vendor tag makes it easier for users to tell where the package came from.