Hey everyone, i noticed something today when running chefspec with chef
11.6.0 and dealing with the template resource.
I did see some larger changes to the template resource as part of the
release and wondering if anyone knows what might be going on.
I have a simple recipe and template (and specific chefspec test)
In the gist you can see that the test fails with a odd error:
- recipe::default should include correct content
Failure/Error: @chef_run.should create_file_with_content @file,
undefined local variable or method `node’ for
(erubis):3:in `block in evaluate’
./spec/default_spec.rb:20:in `block (2 levels) in <top (required)>’
If I converge the recipe - everything works as expected - and the file
is written out with the correct value from the attribute.
If I run this with 11.4.4 the tests pass, but fail with 11.6.0
Reading the 11.6.0 release notes I know there are better ways to do
this (that i’ll be using) but i’m curious why it fails in this case as
there are a bunch of templates that have things like: <%=