Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 75

How to generate/test a template file for rspec tests?

$
0
0
I've created a file resource that is using a template file as content which is generated from a automatic hiera lookup. $source_list_template = template($sources['list.template']) file { 'sources.list': ensure => file, ... content => template($source_list_template), notify => Exec['apt_update'], } I've already figured how to set the :params to make it available to the context: let(:params) { { :sources => { 'list.template' => 'puppet:///files/sources.list.erb', } } } I now need to know how I can create a virtual template file or the content of this file to test how the final file should look like. I've not found this in the documentation on http://rspec-puppet.com and https://github.com/rodjek/rspec-puppet.

Viewing all articles
Browse latest Browse all 75

Trending Articles