summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-08-17 20:01:04 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-08-17 20:01:04 -0700
commit5eec7126f77c10bcdd1e71854a118174724dcf04 (patch)
treecc5786afb63078fcceece9df7a84768425c7cff6
parentcab92167cebcd107667feb32da4257772d8a3226 (diff)
downloadchef-5eec7126f77c10bcdd1e71854a118174724dcf04.tar.gz
add a comment on magic line that makes the specs work
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/unit/data_collector_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/data_collector_spec.rb b/spec/unit/data_collector_spec.rb
index d3a14716cc..bcce058d81 100644
--- a/spec/unit/data_collector_spec.rb
+++ b/spec/unit/data_collector_spec.rb
@@ -39,6 +39,12 @@ describe Chef::DataCollector do
let(:new_resource) do
new_resource = Chef::Resource::File.new("/tmp/a-file.txt")
new_resource.checksum nil
+ # This next line is a hack to work around the fact that the name property will not have been autovivified yet
+ # in these unit tests which breaks some assumptions. Really the Formatters::ErrorMapper.resource_failed and
+ # related APIs need to properly walk and get properties on the resource rather than walking through instance
+ # variables, but the ErrorMappers probably pre-date the conversion to properties. But this next line is necesary
+ # to populate the name_property instance variable (which will happen naturally during the course of running the
+ # provider, so I don't think this is a user-visibile bug).
new_resource.path
new_resource
end