Re: [Puppet Users] Problems writing tests for custom hiera backend

2017-10-02 Thread Craig Dunn
Hi Jos Been meaning to contact you. I plan to re-use some of your code and idea's > from hiera-http. > You might have recognised the snippet in the first message. > > Do you mind? > Not at all - it's Apache 2.0 licensed so anyone can re-use the code if they maintain the license / copyright notic

Re: [Puppet Users] Problems writing tests for custom hiera backend

2017-10-02 Thread jos
Hi Craig, Been meaning to contact you. I plan to re-use some of your code and idea's from hiera-http. You might have recognised the snippet in the first message. Do you mind? I'll have a look at a solution today or tomorrow, but it sounds like I need to mock the class. I should have an app

Re: [Puppet Users] Problems writing tests for custom hiera backend

2017-10-02 Thread Craig Dunn
I've been having the exact same conversation with Henrik as I also need to write tests for hiera-mysql, hiera-http and the Jerakia Hiera 5 backend He suggested copying the approach used by yaml_data and json_data Puppet core but theres a few problems with this. Firstly it uses puppet_spec/comp

[Puppet Users] Problems writing tests for custom hiera backend

2017-09-29 Thread jos
Hi all, I am writing a custom hiera backend for consul and I want to test the functionality. But I am unable to create the proper puppet data structures that are required by the function definition. Part of the function I want to test: Puppet::Functions.create_function(:hiera_consul) do disp