Please sign in to comment.
update code to support more simultaneous versions
This commit is intended to resolve some of the issues related with create_resources support for multiple Puppet versions. Basically, create_resources often needs to be an external dependency if it's used in modules, so that those modules can work with 2.6.x. In this case, it needs to be added to the fixtures.yaml file. Since there is no way to specify that certain dependant modules should only be added for certain versions of Puppet, then create_resources will even override the native one for versions >= 2.7.0 in all unit tests. For this reason, the module needs to be able to simultaneously support the targeted versions: 2.6.x ,2.7.x, 3.0.x, and 3.1.x. This commit does the following: - back ports all 2.7.x changes to create_resources (so that it will work with 3.0) - modifies tests, unit tests so they pass with all targeted versions. - update Rakefile and spec_helper to use puppetlabs_spec_helper of coarse, there is a bigger question of if I should even be doing this, it has several pitfalls: - modules will be tested with an external create_resoures which may not be in sync with the one in core - I would recommend that modules not pull in create_resources as a dep in their module file, which means 1. it becomes an extra step for 2.6.x 2. module's are not tested and used consistenly
- Loading branch information...
Showing with 94 additions and 109 deletions.
- +1 −0 Rakefile
- +48 −20 lib/puppet/parser/functions/create_resources.rb
- +0 −6 spec/spec.opts
- +1 −18 spec/spec_helper.rb
- +44 −65 spec/unit/puppet/parser/functions/create_resources_spec.rb
|@@ -0,0 +1 @@|
|@@ -1,6 +0,0 @@|
|@@ -1,18 +1 @@|
|-dir = Pathname.new(__FILE__).parent|
|-$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib')|
|-gem 'rspec', '=1.2.9'|
|-Spec::Runner.configure do |config||
|- config.mock_with :mocha|
|-# We need this because the RAL uses 'should' as a method. This|
|-# allows us the same behaviour but with a different method name.|
|- alias :must :should|