Commit graph

357 commits

Author SHA1 Message Date
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
cf7ac02860 Merge branch '2.3.x'
* 2.3.x:
  Update CHANGELOG, Modulefile for 2.3.3
2012-05-23 10:56:05 -07:00
Jeff McCune
730aee4ef9 Update CHANGELOG, Modulefile for 2.3.3 2012-05-23 10:52:41 -07:00
Jeff McCune
380f9b66fe Merge branch '2.3.x'
* 2.3.x:
  fix regression in #11017 properly
2012-05-23 10:47:16 -07:00
Jeff McCune
92e3e5c0ec Merge pull request #70 from duritong/2.3.x
fix regression in #11017 properly
2012-05-23 10:45:35 -07:00
Peter Meier
f0a62c7dba fix regression in #11017 properly
We need the defaultvalues for that.
2012-05-23 08:17:57 +02:00
Jeff McCune
8bada95b0d Merge branch '2.3.x'
* 2.3.x:
  Fix spec tests using the new spec_helper
2012-05-11 00:03:54 -07:00
Jeff McCune
b4343e67fd Merge branch '2.2.x' into 2.3.x
* 2.2.x:
  Fix spec tests using the new spec_helper
2012-05-11 00:03:31 -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
Jeff McCune
e8e2a16ce5 Merge branch '2.3.x'
* 2.3.x:
  Update CHANGELOG for 2.3.2 release
  Make file_line default to ensure => present
  Memoize file_line spec instance variables
  Fix spec tests using the new spec_helper
2012-05-10 22:25:14 -07:00
Jeff McCune
beaa812e10 Update CHANGELOG for 2.3.2 release 2012-05-10 22:19:24 -07:00
Jeff McCune
fb43a6ff2f Merge branch 'fix/2.3.x/file_line_ensure' into 2.3.x
* fix/2.3.x/file_line_ensure:
  Make file_line default to ensure => present
  Memoize file_line spec instance variables
  Fix spec tests using the new spec_helper
2012-05-10 22:13:46 -07:00
Jeff McCune
1373e70639 Make file_line default to ensure => present
The examples in the file_line resource documentation state the following
resource should work:

    file_line { 'sudo_rule':
      path => '/etc/sudoers',
      line => '%sudo ALL=(ALL) ALL',
    }

Without this patch the example does not work because ensure is not set
to present.

This patch fixes the problem by setting the default value of ensure to
present.
2012-05-10 22:04:58 -07:00
Jeff McCune
20aacc5a29 Memoize file_line spec instance variables
This just changes the instance variables to a memoized let block and
gets ride of the before :each block.

The patch has no change in behavior.
2012-05-10 22:04:58 -07:00
Jeff McCune
1ebfa5daea 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-10 22:04:58 -07:00
Jeff McCune
11156fd29a Merge branch '2.3.x'
* 2.3.x:
  Revert "Merge remote-tracking branch 'eshamow/tickets/bug/13595_restrict_initialize_everything_for_tests' into 2.2.x"
  (#13595) initialize_everything_for_tests couples modules Puppet ver
2012-04-13 09:57:26 -07:00
Jeff McCune
f84c02011f Merge branch '2.2.x' into 2.3.x
* 2.2.x:
  Revert "Merge remote-tracking branch 'eshamow/tickets/bug/13595_restrict_initialize_everything_for_tests' into 2.2.x"
  (#13595) initialize_everything_for_tests couples modules Puppet ver
2012-04-13 09:56:41 -07:00
Chris Price
83cdff9e05 Merge pull request #61 from cprice-puppet/ticket/master/13693-use-puppetlabs-spec-helper
(#13693) moving logic from local spec_helper to puppetlabs_spec_helper
2012-04-11 17:23:30 -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
Jeff McCune
40da421c04 Merge remote-tracking branch 'eshamow/tickets/bug/13595_restrict_initialize_everything_for_tests' into 2.2.x
* eshamow/tickets/bug/13595_restrict_initialize_everything_for_tests:
  (#13595) initialize_everything_for_tests couples modules Puppet ver
2012-04-04 08:47:06 -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
b9a33851d2 Merge branch '2.4.x'
* 2.4.x:
  (#13439) Fix MRI 1.9 issue with spec_helper
2012-03-29 23:21:09 -07:00
Jeff McCune
d32115979d Merge branch '2.3.x' into 2.4.x
* 2.3.x:
  (#13439) Fix MRI 1.9 issue with spec_helper
2012-03-29 23:21:00 -07: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
69465b0f3e Merge branch 'ticket/2.2.x/13439_fix_spec_helper_try3' into 2.2.x
* ticket/2.2.x/13439_fix_spec_helper_try3:
  (#13439) Fix MRI 1.9 issue with spec_helper
2012-03-29 23:18:39 -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
07700216bb Merge branch '2.4.x'
* 2.4.x:
  (#13439) Fix test failures with Puppet 2.6.x
  (#13439) refactor spec helper for compatibility with both puppet 2.7 and master
2012-03-29 16:57:13 -07:00
Jeff McCune
6b76c33865 Merge branch '2.3.x' into 2.4.x
* 2.3.x:
  (#13439) Fix test failures with Puppet 2.6.x
  (#13439) refactor spec helper for compatibility with both puppet 2.7 and master
2012-03-29 16:56:26 -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
d22fbe32cd Merge branch 'ticket/2.2.x/13439_fix_spec_helper_try2' into 2.2.x
* ticket/2.2.x/13439_fix_spec_helper_try2:
  (#13439) Fix test failures with Puppet 2.6.x
2012-03-29 16:54:42 -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
Jeff McCune
cbdffb711f Merge branch 'ticket/2.2.x/13439_fix_spec_helper' into 2.2.x
* ticket/2.2.x/13439_fix_spec_helper:
  (#13439) refactor spec helper for compatibility with both puppet 2.7 and master
2012-03-29 16:25:55 -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
a1a5f7487d Merge pull request #53 from traylenator/fqdn_rotate
(#13205) Rotate array/string randomley based on fqdn, fqdn_rotate()
2012-03-29 15:48:10 -07:00
Jeff McCune
d37815e5bf Merge branch '2.3.x'
* 2.3.x:
  (#13494) Specify the behavior of zero padded strings
  Update CHANGELOG, Modulefile for 2.1.3
2012-03-29 15:20:41 -07:00
Jeff McCune
fea0b06bc8 Merge branch '2.2.x' into 2.3.x
* 2.2.x:
  (#13494) Specify the behavior of zero padded strings
  Update CHANGELOG, Modulefile for 2.1.3

Conflicts:
	CHANGELOG
	Modulefile
2012-03-29 15:20:28 -07:00
Jeff McCune
10c793f8f0 Merge branch '2.1.x' into 2.2.x
* 2.1.x:
  Update CHANGELOG, Modulefile for 2.1.3

Conflicts:
	CHANGELOG
	Modulefile
2012-03-29 15:19:21 -07:00
Jeff McCune
60afdeda17 Merge branch 'maint/2.2.x/range_spec_tests' into 2.2.x
* maint/2.2.x/range_spec_tests:
  (#13494) Specify the behavior of zero padded strings
2012-03-29 15:17:48 -07:00
Jeff McCune
61891bbe61 (#13494) Specify the behavior of zero padded strings
Without this patch the specified behavior of strings that are numeric
only and zero padded is unclear and untested in the spec tests.  This is
a problem because it's not clear that range('00', '10') will actually
return [ "0", "1", ..., "10" ] instead of [ "00", "01", ..., "10" ]

This patch addresses the issue by providing explicit test coverage.  If
the string conversion behavior of puppet changes, this test will begin
to fail.
2012-03-29 15:17:30 -07:00
Jeff McCune
a033450ab3 Update CHANGELOG, Modulefile for 2.1.3 2012-03-29 09:43:20 -07:00
Steve Traylen
fef247b5db (#13205) Rotate array/string randomley based on fqdn, fqdn_rotate() 2012-03-18 12:19:48 +01:00
Jeff McCune
033eddadc2 Merge branch '2.3.x'
* 2.3.x:
  Update CHANGELOG and Modulefile for 2.3.1
  (#13091) Fix LoadError exception with puppet apply
2012-03-13 17:48:09 -07:00
Jeff McCune
6b8f9dd329 Update CHANGELOG and Modulefile for 2.3.1 2012-03-13 17:35:43 -07:00
Ken Barber
b4b809ef12 Merge pull request #50 from jeffmccune/ticket/2.3.x/13091_stdlib_throws_a_loaderror_when_running_with_puppet_apply
(#13091) Fix LoadError exception with puppet apply
2012-03-13 17:30:44 -07:00
Jeff McCune
ea43e86516 (#13091) Fix LoadError exception with puppet apply
Puppet apply does not add the stdlib lib directory to the $LOAD_PATH.
This is a problem because the puppet_vardir fact requires the
puppet_settings library to be available for the `with_puppet` utility
method.

Without this patch, puppet apply will result in the following error:

    $ puppet apply --modulepath=/vagrant/modules -e 'notice $puppet_vardir'
    warning: Could not load fact file stdlib/lib/facter/puppet_vardir.rb: no such file to load -- facter/util/puppet_settings
    notice: Scope(Class[main]):
    notice: Finished catalog run in 0.01 seconds

With this patch applied, puppet apply works as expected:

    $ puppet apply --modulepath=/vagrant/modules.pe -e 'notice $puppet_vardir'
    notice: Scope(Class[main]): /Users/jeff/.puppet/var
    notice: Finished catalog run in 0.01 seconds

This patch defensively tries to load facter/util/puppet_settings.  If it cannot
load it, it falls back to trying to explicitly locate and load the library.

Once puppet is fixed such that a modules lib directory is truly in the
$LOAD_PATH, the fall back implementation will no longer be exercised since the
LoadError should not be raised.
2012-03-13 16:44:21 -07:00
Jeff McCune
f74705d621 Merge branch '2.3.x'
* 2.3.x:
  Update CHANGELOG, Modulefile for 2.3.0 release
2012-03-12 17:45:35 -07:00
Jeff McCune
f7b8ab71cc Update CHANGELOG, Modulefile for 2.3.0 release 2012-03-12 17:45:12 -07:00
Jeff McCune
ced1f7476e Merge branch '2.3.x'
* 2.3.x:
  (#12357) Fix broken compatibility with Puppet 2.6
  (maint) Comment Ken's fix to String#any?
  (#13018) Fix missing method any? message for ruby 1.9.x
  (#12357) Add ability to display an error message from validate_re
  (#12357) Add validate_absolute_path() function
  (maint) Stop printing the directory of spec_helper
  (#12357) Make facter_dot_d look in Puppet[:confdir]/facts.d
  (#12357) Add puppet_vardir custom fact
  (#12357) Fix root_home fact on Windows
2012-03-12 17:41:24 -07:00