Re: Need help with rspec-puppet

140 views
Skip to first unread message

Jian

unread,
Oct 10, 2012, 10:43:47 AM10/10/12
to puppet...@googlegroups.com
Anybody else received this or similar error?
 
What I was able to figure out so far is that:
by adding "require 'puppet' to the spec test my error changes to:
 
 Error converting value for param 'plugindest': Error converting value for param 'libdir': Could not find value for $vardir on node puppet-demo
 
So not a big improvement. The error probably occurs before the test itself. Because the error is the same even if I delete the tested .pp file.
 
Any help would be appreciated :-).
 

Dňa štvrtok, 4. októbra 2012 10:24:48 UTC+2 Jian napísal(-a):
Hello Everyone,
 
I am fairly new to puppet and I would like to run som unit tests. I hope rspec is the right tool for it. Unfortunately, after setting it up, when I try to execute it I receive the following error:
 
Failures:
  1) helloworld
     Failure/Error: it { should include_class('helloworld') }
     Puppet::Error:
       Error converting value for param 'deviceconfig': Could not find value for $confdir on node puppet-demo
     # ./spec/classes/helloworld_spec.rb:8
Thiss error pops up for any test I try.
 
I wasn't able to find a solution yet. Can you please give me any advice?
 
Thank you.

llowder

unread,
Oct 10, 2012, 10:48:39 AM10/10/12
to puppet...@googlegroups.com


On Wednesday, October 10, 2012 9:43:47 AM UTC-5, Jian wrote:
Anybody else received this or similar error?
 
What I was able to figure out so far is that:
by adding "require 'puppet' to the spec test my error changes to:
 
 Error converting value for param 'plugindest': Error converting value for param 'libdir': Could not find value for $vardir on node puppet-demo
 
So not a big improvement. The error probably occurs before the test itself. Because the error is the same even if I delete the tested .pp file.
 
Any help would be appreciated :-).

What version of puppet are you using?

Can you share your code - module and test? Either put in the email, or for better readability, use pastie or gist.
 

Jian

unread,
Oct 11, 2012, 4:50:17 AM10/11/12
to puppet...@googlegroups.com
I haven't puppetlabs-rspec-helper gem installed.
 
I added it to my ruby gems and chaneged both spec_helper.rb and Rakefile as described here:
 
 
and it works now.
 
Big thanks to everyone that tried to help me. :-)

Dňa streda, 10. októbra 2012 16:48:39 UTC+2 llowder napísal(-a):
Reply all
Reply to author
Forward
0 new messages