Using rspec to check creation of template
- by Brian
I am trying to use rspec with puppet to check the generation of a configuration file from an .erb file. However, I get the error
1) customizations should generate valid logstash.conf
Failure/Error: content = catalogue.resource('file', 'logstash.conf').send(:parameters)[:content]
ArgumentError:
wrong number of arguments (0 for 1)
# ./spec/classes/logstash_spec.rb:29:in `catalogue'
# ./spec/classes/logstash_spec.rb:29
And the logstash_spec.rb:
describe "customizations" do
let(:params) { {:template => "profiles/logstash/output_broker.erb", :options => {'opt_a' => 'value_a' } } }
it 'should generate valid logstash.conf' do
content = catalogue.resource('file', 'logstash.conf').send(:parameters)[:content]
content.should match('logstash')
end
end