diff options
author | antima-gupta <agupta@msystechnologies.com> | 2020-07-13 18:48:44 +0530 |
---|---|---|
committer | antima-gupta <agupta@msystechnologies.com> | 2020-07-13 18:48:44 +0530 |
commit | 4d8fda8e536432355720c05293d24c9c920df3be (patch) | |
tree | 5580aadea45a1b19332860b157cd177fdeb891e6 /spec/integration | |
parent | 04eac6a86e51d71cdbfbe163ebb70a887c1c9ddb (diff) | |
download | chef-4d8fda8e536432355720c05293d24c9c920df3be.tar.gz |
Fixed windows cookbooks upload issue.
Updated cookbook_path option used File::PATH_SEPARATOR to split path.
Added rspec for upload multiple paths cookbooks.
Signed-off-by: antima-gupta <agupta@msystechnologies.com>
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/knife/cookbook_upload_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/integration/knife/cookbook_upload_spec.rb b/spec/integration/knife/cookbook_upload_spec.rb index 79a9efbfb7..e0ab388f50 100644 --- a/spec/integration/knife/cookbook_upload_spec.rb +++ b/spec/integration/knife/cookbook_upload_spec.rb @@ -97,5 +97,31 @@ describe "knife cookbook upload", :workstation do expect { knife("cookbook upload x -o #{cb_dir}") }.to raise_error(Chef::Exceptions::MetadataNotValid) end end + + when_the_repository "have cookbooks at muliple paths" do + let(:cb_dir_first) do + File.join(@repository_dir,"cookbooks") + .gsub(File::SEPARATOR,File::ALT_SEPARATOR || File::SEPARATOR) + end + + let(:cb_dir_second) do + File.join(@repository_dir,"test_cookbooks") + .gsub(File::SEPARATOR,File::ALT_SEPARATOR || File::SEPARATOR) + end + + before(:each) do + file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0") + file "test_cookbooks/y/metadata.rb", cb_metadata("y", "1.0.0") + end + + it "knife cookbook upload with -o or --cookbook-path" do + knife("cookbook upload x y -o #{cb_dir_first}#{File::PATH_SEPARATOR}#{cb_dir_second}").should_succeed stderr: <<~EOM + Uploading x [1.0.0] + Uploading y [1.0.0] + Uploaded 2 cookbooks. + EOM + end + + end end end |