- From: Mathias Lafeldt <
>
- To:
- Subject: [chef] Re: Re: Re: Testing templates with mock node attributes
- Date: Sun, 28 Apr 2013 12:29:13 +0200
Btw, as of ChefSpec 1.0, Fauxhai is part of ChefSpec.
See
https://github.com/acrmp/chefspec#missing-attributes
-Mathias
On Fri, Apr 26, 2013 at 11:33 PM, AJ Christensen
<
>
wrote:
>
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!
>
>
>
>
--
My blog:
http://mlafeldt.github.com
My code:
https://github.com/mlafeldt
My tweets:
https://twitter.com/mlafeldt
Archive powered by MHonArc 2.6.16.