From 5cde8115e3d7bda5b38ac07c66098d83be988ac3 Mon Sep 17 00:00:00 2001 From: snehaldwivedi Date: Fri, 10 Jul 2020 16:11:29 -0700 Subject: Fix knife cookbook upload tests. Signed-off-by: Pete Higgins --- spec/unit/knife/cookbook_upload_spec.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'spec/unit') 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 -- cgit v1.2.1