Ask Your Question
1

rspec-puppet error could not find class

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

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

Comments

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 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

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

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

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.

Gemfile:

# Install via
# bundle install --path vendor/gems
#
# See http://bombasticmonkey.com/2011/11/04/test-your-puppet-modules-functions/
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 ...
(more)
edit flag offensive delete link more

Comments

Thank you, that worked like a charm

dgutierrez1287 gravatar imagedgutierrez1287 ( 2013-11-19 14:37:26 -0500 )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

2 followers

Stats

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

Seen: 1,868 times

Last updated: Nov 21 '13