It would be great if we could verify that our Puppet manifests satisfy certain expectations without even having to run Puppet. The rspec-puppet
tool is a nifty tool for this. Based on RSpec, a testing framework for Ruby programs, rspec-puppet
lets you write test cases for your Puppet manifests that are especially useful for catching regressions (bugs introduced when fixing another bug) and refactoring problems (bugs introduced when reorganizing your code).
Here's what you'll need to do to install rspec-puppet
.
Run the following commands:
t@mylaptop $ sudo /opt/puppetlabs/puppet/bin/gem install rspec-puppet Fetching: rspec-support-3.7.1.gem (100%) Successfully installed rspec-support-3.7.1 ... Installing ri documentation for rspec-puppet-2.6.11 Done installing documentation for rspec-support, rspec-core, diff-lcs, rspec-expectati ons, rspec-mocks, rspec, rspec-puppet after 4 seconds 7 gems installed
This uses the Gem included with...