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,
NameError:
undefined local variable or method `node’ for
#Erubis::Context:0x007fccc30b9bf8
(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: <%=
node[“foo”][“bar”][“baz”] %>
I have a simple recipe and template (and specific chefspec test) chefspec run · GitHub
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,
NameError:
undefined local variable or method node' for #<Erubis::Context:0x007fccc30b9bf8> # (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: <%= node["foo"]["bar"]["baz"] %>
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. Chef Infra Client Release Notes
I have a simple recipe and template (and specific chefspec test) chefspec run · GitHub
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,
NameError:
undefined local variable or method node' for #<Erubis::Context:0x007fccc30b9bf8> # (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: <%= node["foo"]["bar"]["baz"] %>