summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsnehaldwivedi <sdwivedi@msystechnologies.com>2020-07-10 16:11:29 -0700
committerTim Smith <tsmith84@gmail.com>2020-07-15 12:35:28 -0700
commit036dc1354b031b32527d952f283f00e60ee998f4 (patch)
tree681abe6bf73f3ceff2bcce26ec96ff40865509ff
parent74ca9aa2c8c8329d2d4a6364a56c2b3f8ca901bb (diff)
downloadchef-036dc1354b031b32527d952f283f00e60ee998f4.tar.gz
Fix knife cookbook upload tests.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-rw-r--r--spec/unit/knife/cookbook_upload_spec.rb11
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