The openbsd spec tests mistakenly used File.new instead of File.open.
Fix this to use .read, not .open.
(Maint): Re-enable tests on Windows

These tests now pass on Windows.  Removed the `pending` block and
re-indented, no code changes.
(#11870) Add registry module

Ruby includes a built-in set of modules and classes for interacting with
the registry, however, it is only present on Windows.  This makes it
difficult to write spec tests that can run on non-Windows platforms due to
the `Win32` namespace and related constants.

This commit adds a utility module to wrap the Windows specific code.  This
way if you write a module/class that uses the registry, you can just add
expects/stub expectations to the utility module or the class that
includes/extends it.
(#11870) Refactor windows-specific requires

Previously, we were explicitly requiring windows-specific code, which
made it hard to write spec tests that still run on non-Windows platforms.

This commit refactors the requires into the
`Puppet.features.microsoft_windows?` definition, so that if we are on
Windows all of our dependencies will be satisified, and if we're not on
Windows, we won't accidentally load code that doesn't apply.  Also,
re-ordered the dependencies based on where they come from, e.g. ruby vs
gem.
(#11870) Add package options parameter

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.
(#15521) Convert to using host stub wrapper

This patch converts the module acceptance code to using the host stub wrapper
now provided in puppet-acceptance: `stub_forge_on`.

This will allow us to change the forge host we are stubbing dynamically as
apposed to manually changing it everywhere in acceptance code.

This also changes the cases where we have teardown code to use the new
`teardown` block, and to use `rm -rf` for file cleanup to avoid puppet backup
duplication issues.
(#15547) make sure that the LANG sentinels being used are present

previously, we used es_ES.UTF-8 as the sentinel value while checking for override
of LANG values in user environment. commands in solaris errors out when the LANG
being used is not present in the locales installed in the system.

This patch changes the lang sentinel being used to en_US.UTF-8 which is present in
a normal solaris install.

For checking the overriding, the procedure is to change the LANG to "C" which is
different from either so we modify the behavior of the test itself.
Don't issue deprecation warnings for allow_ip

A deprecation warning was issued when IP addresses were used with allow. One
had slipped through and was still printing when allow_ip was used.
Merge remote-tracking branch 'rahul/ticket/3.x/15547_valid_lang_sentinels' into 3.x

* rahul/ticket/3.x/15547_valid_lang_sentinels:
  (#15547) make sure that the LANG sentinels being used are present
(#15569) ensure that augeas prints parse errors.

Ensure that loading augeas files prints parse errors if any.

This seems to have fallen through the cracks. It was originally
present in pull/733 ticket:14136

This fixes the build failure that was present in boxes that contained
augeas.
(#14515) Tests fail with mocha 0.11.4

Prior to this commit, these tests only worked with mocha 0.10.5 because
the tests were broken and trying to stub methods on nil, which mocha
0.11.4 no longer allows. After this commit, these tests work with both
mocha 0.10.5 and 0.11.4.
Fix stubbing on nil in some specs
Don't require mocha in spec_helper

Rspec will automatically require mocha, and it knows how to do it properly
depending on the mocha version. This eliminates spurious deprecation warnings
about how mocha is loaded.
Rename specs to end in _spec.rb
Avoid stubbing Thread::new due to issues in newer mocha

In mocha >= 0.11.0, unstubbing a method is done by defining a method that
calls the original method. Somehow this indirection causes issues when
Thread::new is stubbed, and the new thread does not have proper access to
local variables. This patch fixes this from both ends, by not stubbing
Thread::new and not using local variables in the test that was failing.
Check that function loading worked correctly.

In some odd circumstances - typically, just development errors - you can wind
up in a world where a function correctly loads but isn't available.

This ensures that the method is defined as expected and raises a clear, quick
error if not. The alternative is an unclear stack overflow raised because we
recurse forever through method_missing.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>

Conflicts:
	lib/puppet/parser/scope.rb
Clear Environment.current when calling Environment.clear

This makes Puppet::Node::Environment::clear properly clear all the environment
state. This reduces dependencies between tests due to leaked state. It also
moves the call to clear to happen before each test. This avoids issues where
tests set up stubs on settings, as the after block is called before stubs are
removed.
Add Puppet::Parser::Functions::clear for specs

Since functions uses class instance variables to track which functions are
loaded, we need to clear this between tests.
Merge pull request #1016 from pcarlisle/maint/2.7.x/mocha12

Maint/2.7.x/mocha12