diff options
author | snehaldwivedi <sdwivedi@msystechnologies.com> | 2020-07-10 16:11:29 -0700 |
---|---|---|
committer | Pete Higgins <pete@peterhiggins.org> | 2020-07-10 16:11:29 -0700 |
commit | 5cde8115e3d7bda5b38ac07c66098d83be988ac3 (patch) | |
tree | c04bce289ba5285a4df2daa1eb0e3272b15bdb7a | |
parent | 8fe1efd502e85454c3e0319646d89583d6f17b38 (diff) | |
download | chef-5cde8115e3d7bda5b38ac07c66098d83be988ac3.tar.gz |
Fix knife cookbook upload tests.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-rw-r--r-- | spec/unit/knife/cookbook_upload_spec.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb index 661eb779ea..bc13ce834c 100644 --- a/spec/unit/knife/cookbook_upload_spec.rb +++ b/spec/unit/knife/cookbook_upload_spec.rb @@ -323,19 +323,18 @@ describe Chef::Knife::CookbookUpload do context "when cookbook path is an array" do it "should warn users that no cookbooks exist" do - knife.config[:cookbook_path] = ["/chef-repo/cookbooks", "/home/user/cookbooks"] - expect(knife.ui).to receive(:warn).with( - /Could not find any cookbooks in your cookbook path: '#{knife.config[:cookbook_path].join(', ')}'\. Use --cookbook-path to specify the desired path\./ - ) + cookbook_path = windows? ? "C:/chef-repo/cookbooks" : "/chef-repo/cookbooks" + knife.config[:cookbook_path] = [cookbook_path, "/home/user/cookbooks"] + expect(knife.ui).to receive(:warn).with("Could not find any cookbooks in your cookbook path: '#{knife.config[:cookbook_path].join(", ")}'. Use --cookbook-path to specify the desired path.") knife.run end end context "when cookbook path is a string" do it "should warn users that no cookbooks exist" do - knife.config[:cookbook_path] = "/chef-repo/cookbooks" + knife.config[:cookbook_path] = windows? ? "C:/chef-repo/cookbooks" : "/chef-repo/cookbooks" expect(knife.ui).to receive(:warn).with( - /Could not find any cookbooks in your cookbook path: '#{knife.config[:cookbook_path]}'\. Use --cookbook-path to specify the desired path\./ + "Could not find any cookbooks in your cookbook path: '#{knife.config[:cookbook_path]}'. Use --cookbook-path to specify the desired path." ) knife.run end |