diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-10-05 14:49:02 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-10-05 14:52:39 -0700 |
commit | fd42d49ed5e9b32ac0763a7f7483a7450a4702e7 (patch) | |
tree | 0c8370e80309797f26f0fc3b510931fd959a50d1 /spec/unit/cookbook | |
parent | 1cdd613855778050dee83fbc17cced869e9a7c5c (diff) | |
download | chef-fd42d49ed5e9b32ac0763a7f7483a7450a4702e7.tar.gz |
add a spec for the fix to #5089
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/cookbook')
-rw-r--r-- | spec/unit/cookbook/file_vendor_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/cookbook/file_vendor_spec.rb b/spec/unit/cookbook/file_vendor_spec.rb index 139a5932f9..164fbd8177 100644 --- a/spec/unit/cookbook/file_vendor_spec.rb +++ b/spec/unit/cookbook/file_vendor_spec.rb @@ -94,4 +94,19 @@ describe Chef::Cookbook::FileVendor do end + context "when vendoring a cookbook with a name mismatch" do + let(:cookbook_path) { File.join(CHEF_SPEC_DATA, "cookbooks") } + + # A manifest is a Hash of the format defined by Chef::CookbookVersion#manifest + let(:manifest) { { :cookbook_name => "name-mismatch" } } + + before do + file_vendor_class.fetch_from_disk(cookbook_path) + end + + it "retrieves the file from the correct location based on path to the cookbook that conatins the correct name metadata" do + file_vendor = file_vendor_class.create_from_manifest(manifest) + file_vendor.get_filename("metadata.rb") + end + end end |