Commit graph

20 commits

Author SHA1 Message Date
Jeff McCune
243c7c2a49 Merge branch '2.3.x'
* 2.3.x:
  (Maint) Don't mock with mocha
  (Maint) Fix up the get_module_path parser function
  (Maint) use PuppetlabsSpec::PuppetSeams.parser_scope (2.3.x)
  (Maint) Rename PuppetlabsSpec::Puppet{Seams,Internals}
  (Maint) use PuppetlabsSpec::PuppetSeams.parser_scope
  (Maint) Fix interpreter lines

Conflicts:
	spec/spec_helper.rb
	spec/unit/puppet/parser/functions/get_module_path_spec.rb
2012-07-23 15:59:52 -07:00
Jeff McCune
8a4e115ccb (Maint) use PuppetlabsSpec::PuppetSeams.parser_scope
Without this patch all of the spec tests for parser functions in stdlib
would instantiate their own scope instances.  This is a problem because
the standard library is tightly coupled with the internal behavior of
Puppet.  Tight coupling like this creates failures when we change the
internal behavior of Puppet.  This is exactly what happened recently
when we changed the method signature for the initializer of
Puppet::Parser::Scope instances.

This patch fixes the problem by creating scope instances using the
puppet labs spec helper.  The specific method that provides scope
instances in Puppet-version-independent way is something like this:

 let(:scope) { PuppetlabsSpec::PuppetSeams.parser_scope }

This patch simply implements this across the board.
2012-07-19 16:24:57 -07:00
Branan Purvine-Riley
d9410f72e4 Require the new puppetlabs_spec_helper gem name 2012-05-31 09:10:27 -07:00
Branan Purvine-Riley
2247df4f6e Update for new gem version of puppetlabs_spec_helper
This updates the Rakefile and spec_helper to use the common versions
available in the puppetlabs_spec_helper rubygem branch. This mostly
just removes a bunch of duplicated code, but it also gives us more
flexibility in how the module is tested in the future.
2012-05-29 15:53:46 -07:00
Jeff McCune
7d3433345e Fix spec tests using the new spec_helper
This patch back ports the file from the master branch.  The spec tests
fail without this patch applied.  This should make it easier to setup
Puppet settings using the puppet_spec_helper project.
2012-05-11 00:01:32 -07:00
Chris Price
85f96dfb24 (#13693) moving logic from local spec_helper to puppetlabs_spec_helper
This should simplify future compatibility between various versions
of stdlib and various versions of puppet core.
2012-04-11 10:13:24 -07:00
Jeff McCune
98aa06468a Revert "Merge remote-tracking branch 'eshamow/tickets/bug/13595_restrict_initialize_everything_for_tests' into 2.2.x"
This reverts commit 40da421c04, reversing
changes made to 69465b0f3e.
2012-04-04 08:56:35 -04:00
Eric Shamow
3222f35de8 (#13595) initialize_everything_for_tests couples modules Puppet ver
Replace regex used in spec_helper.rb to disallow both Puppet 2.6 and any
2.7 prior to 13.
2012-04-03 23:26:36 -04:00
Jeff McCune
56092811b5 Merge branch '2.2.x' into 2.3.x
* 2.2.x:
  (#13439) Fix MRI 1.9 issue with spec_helper
2012-03-29 23:20:32 -07:00
Jeff McCune
15c5fd1f41 (#13439) Fix MRI 1.9 issue with spec_helper
When using MRI 1.9.x the stdlib spec helper does not invoke because
Puppet.settings.private_methods returns symbols instead of strings.

This is a problem because we need to set default configuration settings
like Puppet[:vardir] when using the compiler.

This patch fixes the issue by simply checking the Puppet version.  This
seems a better choice than rescuing NoMethodError since the method might
be renamed or removed in the future.
2012-03-29 23:18:15 -07:00
Jeff McCune
6065628493 Merge branch '2.2.x' into 2.3.x
* 2.2.x:
  (#13439) Fix test failures with Puppet 2.6.x
2012-03-29 16:55:46 -07:00
Jeff McCune
665610baaf (#13439) Fix test failures with Puppet 2.6.x
Without this patch the spec_helper sends a message named
initialize_everything_for_tests to Puppet.settings.  This is a problem
because Puppet 2.6.x does not have this method, only Puppet 2.7.x and
Puppet master have this method at this time and we're getting false
positive test failures.

This patch fixes the problem by looking before we leap.  We test if the
private method exists before calling it.  This works with Ruby 1.8.5 and
onwards and Puppet 2.6, 2.7 and master.

This should fix all of the failures I've caused in Jenkins today.
2012-03-29 16:52:15 -07:00
Jeff McCune
4ab56c385a Merge branch '2.2.x' into 2.3.x
* 2.2.x:
  (#13439) refactor spec helper for compatibility with both puppet 2.7 and master
2012-03-29 16:26:13 -07:00
cprice
82194ca7e7 (#13439) refactor spec helper for compatibility with both puppet 2.7 and
master
2012-03-29 16:25:09 -07:00
Jeff McCune
3310b9e190 (maint) Stop printing the directory of spec_helper
Without this patch every rspec run prints out the directory of the
spec_helper script.

I think this was just a debugging line or whatever that accidentally got
added.
2012-03-07 11:51:31 -08:00
Jeff McCune
cc001095b3 (Maint) Make rspec tests work with Puppet 2.6.4
The behavior without this patch applied is that the rspec tests do not
function with Puppet 2.6.4.  This patch back-ports some fixes introduced
in Puppet 2.7.x to the spec_helper to make the tests work as expected on
Puppet 2.6.4.

The specific patches back ported from Puppet are:

 * 2ae88067 (Puppet::Util::ExecutionStub.reset)
 * cf183534 (Switched spec tests to use a class rather than Array as the
             log destination.)
2011-10-10 11:58:48 -07:00
Jeff McCune
11c1837745 (#9859) Add root_home fact and tests
Without this patch applied, the stdlib module does not provide a
root_home fact.  This fact is necessary to easily determine the root
account home directory on platforms Puppet is supported on.

The major variations this fact address are:
---
solaris: /
linux: /root
macosx: /var/root

Spec tests using rspec have been provided as well to cover these three
general cases.  Windows tests are marked as pending.
2011-10-03 11:51:05 -07:00
Ken Barber
aa27fc76c7 (#8797) Merge puppetlabs-functions into puppetlabs-stdlib
It was decided that maintaining puppetlabs-functions and
puppetlabs-stdlib was duplication as both are trying to
achieve the same goal.

This patch provides a merge of the puppetlabs-functions
into the puppetlabs-stdlib repository, with history
preservation.

The following conflicts were found and resolved:

* LICENSE file from functions was used as it aligns with
  ASL usage instructions and contains relevant copyright
  information:
  http://www.apache.org/licenses/LICENSE-2.0.html
* Used spec_helper.rb from functions - this is what
  Puppet core uses and doesn't break tests.
* Merged .gitignore and spec.opts options.
2011-08-05 10:31:46 +01:00
Ken Barber
157531cd29 Copied function test scaffolding from puppet. 2011-06-29 12:25:43 +01:00
Jeff McCune
6e9d0465bc Initial commit 2011-05-24 11:06:30 -07:00