Search code examples
puppet

Puppet module using join works in production but breaks tests


I have a module which includes the line:

join(lookup('latest_packages'),"\n")

In production it works but I'm trying to re-structure the module based on the template from puppet module generate, including the tests.

When I run rake spec I get back:

  1) custom_facts with default values for all parameters should contain Class[custom_facts]
     Failure/Error: it { should contain_class('custom_facts') }

     Puppet::PreformattedError:
       Evaluation Error: Unknown function: 'join'. at /home/philip/projects/control-repo-globals/modules/custom_facts/spec/fixtures/modules/custom_facts/manifests/init.pp:8:16 on node philip-thinkpad-t420.lan

How can I access the join function from inside the tests?


Solution

  • I was able to fix the problem by creating a .fixtures.yml that included the standard puppet library:

    fixtures:
      repositories:
        stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git