Why do I get puppet-rspec 'class does not exist' when it does?

25 views
Skip to first unread message

Haani Niyaz

unread,
Jun 21, 2015, 9:52:29 PM6/21/15
to puppet...@googlegroups.com
I setup a new demo module with the following Gemfile which worked as expected:

source 'https://rubygems.org'


if puppetversion = ENV['PUPPET_GEM_VERSION']
  gem
'puppet', puppetversion, :require => false
else
  gem
'puppet', '3.7.5'
end


gem
'metadata-json-lint'
gem
'puppetlabs_spec_helper', '>= 0.1.0'
gem
'puppet-lint', '>= 1.0.0'
gem
'facter', '>= 1.7.0'
gem
'rspec-puppet-facts'


# rspec must be v2 for ruby 1.8.7
if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9'
  gem
'rspec', '~> 2.0'
end



However when I cloned an existing module silex  and updated the Gemfile to look like the above and I run:

bundle exec rake spec

I get the following error:



vagrant$ bundle
exec rake spec
/usr/bin/ruby -S rspec spec/classes/init_spec.rb --color
F


Failures:


 
1) silex with defaults for all parameters should contain Class[silex]
     
Failure/Error: it { should contain_class('silex') }
     
Puppet::Error:
       
Could not find class silex for centos65-box-1 on node centos65-box-1
     
# ./spec/classes/init_spec.rb:5


Finished in 0.31963 seconds
1 example, 1 failure


Failed examples:


rspec
./spec/classes/init_spec.rb:5 # silex with defaults for all parameters should contain Class[silex]




Reply all
Reply to author
Forward
0 new messages