The openbsd spec tests mistakenly used File.new instead of File.open.
Fix this to use .read, not .open.
(#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.
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
Merge branch '2.7.x' into 3.x

* 2.7.x:
  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
  (#14515) Tests fail with mocha 0.11.4

Conflicts:
	spec/unit/network/http/webrick_spec.rb
	spec/unit/parser/functions/require_spec.rb
	spec/unit/parser/functions/template_spec.rb
Merge remote-tracking branch 'rahul/ticket/3.x/15569_fix_augeas_print_errors' into 3.x

* rahul/ticket/3.x/15569_fix_augeas_print_errors:
  (#15569) ensure that augeas prints parse errors.
(#9416) Rename zfs provider from solaris to zfs

Previously the name of the `zfs` provider was `solaris`. This commit
changes it to be `zfs` in preparation for supporting the resource type
on other platforms.
(#9416) Confine based on the presence of a `zfs` command

Previously, the zfs provider was confined to solaris and assumed the
existence of `/usr/sbin/zfs`. This commit changes the command to a
relative path, which will use `Puppet::Util.which` to resolve the
command. The default search path is set by the `path` setting in
puppet.conf.

Based on work by Marc Fournier <marc.fournier@camptocamp.com>
(#9416) Rename zpool provider from solaris to zpool

Previously the name of the `zpool` provider was `solaris`. This commit
changes it to be `zpool` in preparation for supporting the resource type
on other platforms.
(#9416) Confine based on the presence of a `zpool` command

Previously, the zpool provider was confined to solaris and assumed the
existence of `/usr/sbin/zpool`. This commit changes the command to a
relative path, which will use `Puppet::Util.which` to resolve the
command. The default search path is set by the `path` setting in
puppet.conf.

Based on work by Marc Fournier <marc.fournier@camptocamp.com>