diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2020-08-17 20:01:04 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2020-08-17 20:01:04 -0700 |
commit | 5eec7126f77c10bcdd1e71854a118174724dcf04 (patch) | |
tree | cc5786afb63078fcceece9df7a84768425c7cff6 | |
parent | cab92167cebcd107667feb32da4257772d8a3226 (diff) | |
download | chef-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.rb | 6 |
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 |