Hi Amos,
Here's what I've done:
in spec/spec_helper.rb:
Puppet.settings[:confdir] = "spec/fixtures"
then in the class I was working on, I made a parameter:
class foo(
$puppetdir = $settings::confdir
){
…
}
then in that class's spec test:
require 'spec_helper'
require 'puppetlabs_spec_helper/module_spec_helper'
foo = Puppet.settings[:confdir]
describe 'foo', :type => :class do
let (:params) do { 'puppetdir' => foo } end
…
it stands to reason that a similar method could be employed to feed your
function, but I'm not certain.
On Wed, Jun 26, 2013 at 9:23 PM, Amos Shapira <[email protected]>wrote:
> Hello,
>
> I'm writing my first puppet function rspec test and am having a problem
> which I don't see how to solve.
>
> The function (and the test) involve access to files through the File
> Server. In order for the function (and the test) to work I need to pass
> "--fileserverconf=fileserver.conf" parameter to Puppet.
>
> So far I haven't found a way to do that.
>
> If I understand the rspec-puppet source at
> https://github.com/rodjek/rspec-puppet/blob/master/lib/rspec-puppet.rbcorrectly
> then the list of parameters I can pass is limited to the ones
> mentioned in lines 16-22. Am I right?
>
> Does anyone know how can I pass other parameters, or otherwise affect
> Puppet's configuration to set this value?
>
> Thanks,
>
> --Amos
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.