Ask Your Question

rspec-puppet error could not find class

asked 2013-11-17 08:49:24 -0600

dgutierrez1287 gravatar image

I'm getting the following error when trying to run an rspec-puppet test

Puppet::Error: Could not find class rpmbuild for <hostname> on node <hostname></hostname></hostname>

I have tried a lot of different settings in spec_helper file and still getting the same error.

Thanks in advance for any help

edit retag flag offensive close merge delete


If that's your own module please add the rspec code if that's a public available module could you send us a link ?

golja gravatar imagegolja ( 2013-11-17 19:37:21 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-11-18 06:20:22 -0600

updated 2013-11-21 04:30:31 -0600

The following code is a basic spec file setup which I use for most of my modules. We use puppetlabsspechelper gem and a .fixtures.yml file to ensure proper path names for the modules.


# Install via
# bundle install --path vendor/gems
# See
source :rubygems
# < 0.13 works around a bug in rspec that
# will be fixed with the next release.
gem 'mocha',        '< 0.13'
gem 'puppet',       '>= 3.1.1'
gem 'facter',       '>= 1.6.10'
gem 'puppet-lint'
# we want a special version of rspec-puppet which uses additional hiera lookup
gem 'rspec-puppet ...
edit flag offensive delete link more


Thank you, that worked like a charm

dgutierrez1287 gravatar imagedgutierrez1287 ( 2013-11-19 14:37:26 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2013-11-17 08:49:24 -0600

Seen: 2,059 times

Last updated: Nov 21 '13