summaryrefslogtreecommitdiff
path: root/spec/unit/resource_spec.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-10-22 14:03:16 -0700
committerTim Smith <tsmith84@gmail.com>2021-10-27 12:38:25 -0700
commit4600606675d223f82a763ffd6f2df01e68c54f3f (patch)
tree87dbd9eb3ab566d078214f0db5326e1f22fb8cc7 /spec/unit/resource_spec.rb
parentd61840ae9c1d0e089e927b2761242bdf219e61cc (diff)
downloadchef-reporting.tar.gz
Fix reporting/data_collector for @recipe_filesreporting
When individual recipes are invoked like 'chef-client ./whatever.rb' those files get a cookbook_name of `@recipe_files` which is a magic value that nees to be handled specially to avoid the reporting classes from blowing up. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/resource_spec.rb')
-rw-r--r--spec/unit/resource_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index f7109cc680..b8c1a031e2 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -348,6 +348,11 @@ describe Chef::Resource do
it "should recognize dynamically defined resources" do
expect(resource.defined_at).to eq("dynamically defined")
end
+
+ it "should return nil for the cookbook_version when the cookbook_name is @recipe_files" do
+ resource.cookbook_name = "@recipe_files"
+ expect(resource.cookbook_version).to be nil
+ end
end
describe "to_s" do