diff options
author | Stuart Preston <stuart@chef.io> | 2018-07-03 11:36:12 +0100 |
---|---|---|
committer | Stuart Preston <stuart@chef.io> | 2018-07-03 11:36:12 +0100 |
commit | f5698c4927ff4950002bd521fc606c25dd656b16 (patch) | |
tree | f130dd8a47d36e8ed2623def4dbeb41c2b99daff | |
parent | 7910a42ca5999ae44c5b6b3dc256558b32b42481 (diff) | |
download | chef-sp/7413.tar.gz |
Adding failing test for command with arguments containing quotes and spacessp/7413
Signed-off-by: Stuart Preston <stuart@chef.io>
-rw-r--r-- | spec/functional/resource/windows_task_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/functional/resource/windows_task_spec.rb b/spec/functional/resource/windows_task_spec.rb index 05f46d20ce..da01371d89 100644 --- a/spec/functional/resource/windows_task_spec.rb +++ b/spec/functional/resource/windows_task_spec.rb @@ -71,6 +71,17 @@ describe Chef::Resource::WindowsTask, :windows_only do expect(current_resource.task.parameters).to eq("-W -L C:\\\\chef\\\\chef-ad-join.log") end + # https://github.com/chef/chef/issues/7413 + it "creates scheduled task and sets command arguments with spaces in the argument" do + subject.command "powershell.exe -file \"C:\\Program Files\\app\\script.ps1\"" + call_for_create_action + # loading current resource again to check new task is creted and it matches task parameters + current_resource = call_for_load_current_resource + expect(current_resource.exists).to eq(true) + expect(current_resource.task.application_name).to eq("powershell.exe") + expect(current_resource.task.parameters).to eq("-file \"C:\\Program Files\\app\\script.ps1\"") + end + it "does not converge the resource if it is already converged" do subject.command "chef-client -W -L 'C:\\chef\\chef-ad-join.log'" subject.run_action(:create) |