- From: AJ Christensen <
>
- To: chef <
>
- Subject: [chef] Re: Re: Testing templates with mock node attributes
- Date: Sat, 27 Apr 2013 09:33:21 +1200
Check out fauxhai for combination with chefspec -- sethvargo project;
contains huge amounts of mock ohai data -- may be useful.
Cheers,
AJ
On 27 April 2013 06:37, Scott M. Likens
<
>
wrote:
>
Carlton,
>
>
You can specify attributes for a test scenario in .kitchen.yml if you are
>
using test-kitchen. Review
>
https://github.com/opscode/test-kitchen/blob/1.0/README.md and scan down to
>
The Kitchen YAML Format. chef-rvm uses attributes so it maybe worth a
>
review. https://github.com/fnichol/chef-rvm
>
>
Hope that helps
>
>
Scott
>
>
On 4/26/13 11:32 AM, Carlton Stedman wrote:
>
>
Ohai, Chefs,
>
>
I have been trying to use a test-driven development method for baking Chef
>
recipes and have been having good success with chefspec and
>
minitest-chef-handler. However, one area that currently is difficult to test
>
are templates.
>
>
I am looking for a way to get the output of erb templates, correctly
>
substituting in node attributes (e.g. have a <%= node[:something] %> and
>
want to get it to substitute correctly). So far, I haven't found a solution.
>
>
I was wondering if anyone has a solution to this?
>
>
Otherwise, I am considering working on one, perhaps using Fauxhai to mock
>
for node attribute substitution.
>
>
Thanks a lot,
>
Carlton
>
!DSPAM:517ac843209751804284693!
>
>
Archive powered by MHonArc 2.6.16.