rspec-puppet | RSpec tests for your Puppet manifests | UI Testing library
kandi X-RAY | rspec-puppet Summary
kandi X-RAY | rspec-puppet Summary
RSpec tests for your Puppet manifests
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- This method is called to generate a cookbook catalog
- Returns a hash of facts for this node .
- Build a compiler compiler
- Create a manifest file
- Gets the results of a report
- Finds and returns a list of modules for the specified module .
rspec-puppet Key Features
rspec-puppet Examples and Code Snippets
Community Discussions
Trending Discussions on rspec-puppet
QUESTION
When running Rspec-puppet tests, a deprecation warning is seen:
...ANSWER
Answered 2019-Jan-06 at 22:57It is actually necessary to open two configuration blocks, whereas the mock_with
config must be declared before the puppetlabs_spec_helper
is required.
In other words, like this:
QUESTION
In .fixtures.yml
, there are modules downloaded from a public library, such as stdlib and concat in the following example:
ANSWER
Answered 2017-Oct-24 at 02:09Until recently, the Puppetlabs_spec_helper actually behaved the way you wanted it to, i.e. the fixtures directory was not cleaned unless all the tests pass.
I notice this patch here changed that behaviour. For what it's worth, I also don't agree with that change.
Anyway, if you want the old behaviour, you could:
Use an earlier version of Puppetlabs_spec_helper.
Define a custom spec task.
Or just run
bundle exec rake spec_prep spec_standalone
.Or if you just want to run the tests in one file, run
bundle exec rake spec_prep; bundle exec rspec spec/somefile_spec.rb --fail-fast
. (The--fail-fast
option is useful when debugging failing tests and it causes rspec to abort on the first failure.)
To define a custom spec task with the old behaviour, add this to your Rakefile:
QUESTION
I am new to rspec-puppet, and i am beginning with test writing:
I wrote this code:
...ANSWER
Answered 2017-Feb-17 at 08:12Remove or fix your pre_condition, it isn't generating a valid Puppet manifest:
QUESTION
This may be a simple matter of mocking a resource, but...
...ANSWER
Answered 2017-Mar-04 at 13:53There isn't really much support in rspec-puppet for this, as a class test parameters list is generated from the :params
assuming only strings (or nested hashes/arrays etc. containing strings) or a couple of permitted symbol values used almost literally, :undef
and :default
. It doesn't have a way of passing in resource references.
A workaround exists that lets you put literal content into a manifest though, by passing an object that responds to the inspect
method. For example, in your spec_helper.rb
:
QUESTION
I have a puppet module project that fails when trying to update Gems, although it works in some computers. The Gems are used for the spec tests of the module.
Here's the command I run and the output:
...ANSWER
Answered 2017-Jan-04 at 17:30So, after further research, I found that the problem was not related to my code, files or configuration but with a problem with Rubygems.
Bottomline, I had to follow this link and manually update the certificate.
It looks like ruby wasn't able to connect to the server to check for dependencies of the gems I was requiring.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rspec-puppet
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page