Re: [Puppet Users] rspec-puppet testing with puppet $::settings

2013-05-02 Thread Simon Piette
Hi Wolf, On Wed, May 1, 2013 at 11:13 AM, Wolf Noble w...@wolfspyre.com wrote: I suspect what's going on here, is the class you're testing doesn't have the ability to override the $::settings::vardir variable. I've found that if I make the relevant variable a parameter to the class in

Re: [Puppet Users] rspec-puppet testing with puppet $::settings

2013-05-01 Thread Wolf Noble
Hi Simon, On Tue, Apr 30, 2013 at 12:08 PM, Simon Piette piette.si...@gmail.comwrote: Hi Wolfe, On Tue, Apr 30, 2013 at 12:05 PM, Wolf Noble wno...@datapipe.com wrote: Hi Simon, On Apr 29, 2013, at 7:45 PM, Simon Piette piette.si...@gmail.com wrote: What I've done elsewhere is to make

Re: [Puppet Users] rspec-puppet testing with puppet $::settings

2013-04-30 Thread Wolf Noble
Hi Simon, On Apr 29, 2013, at 7:45 PM, Simon Piette piette.si...@gmail.com wrote: Hi all, snip Any solution for testing variables that depends on settings will be welcome. Thanks, I sent this last night from another account, but it didn't seem to go through: What I've done elsewhere is

Re: [Puppet Users] rspec-puppet testing with puppet $::settings

2013-04-30 Thread Simon Piette
Hi Wolfe, On Tue, Apr 30, 2013 at 12:05 PM, Wolf Noble wno...@datapipe.com wrote: Hi Simon, On Apr 29, 2013, at 7:45 PM, Simon Piette piette.si...@gmail.com wrote: What I've done elsewhere is to make a parameter for, in your case, vardir: (untested, but close) Class foo($vardir =

Re: [Puppet Users] rspec-puppet testing with puppet $::settings

2013-04-30 Thread Wolf Noble
Hi Simon, On Apr 29, 2013, at 23:35, Simon Piette piette.si...@gmail.com wrote: Hi all, snip Any solution for testing variables that depends on settings will be welcome What I've done elsewhere is to make a parameter for, in your case, vardir: (untested, but close) Class foo($vardir =

[Puppet Users] rspec-puppet testing with puppet $::settings

2013-04-29 Thread Simon Piette
Hi all, Let's say I have this in a manifest: file { ${::settings::vardir}/files: ensure = directory } And I want to test it in the catalog using: it { should create_file('/var/lib/puppet/files') } It won't work because an mktemp directory is made for vardir for each catalogue. The catalogue