diff options
author | Marc Chamberland <mchamberland@pbsc.com> | 2019-04-25 23:58:27 -0400 |
---|---|---|
committer | Marc Chamberland <mchamberland@pbsc.com> | 2019-04-26 00:24:33 -0400 |
commit | 0fb79f0a5f8d2c8ca1f9ddb0d0b0267b300dc81f (patch) | |
tree | 7984d75e847846eb31923fd26ef51e625d55a0d5 /spec/functional/resource/windows_task_spec.rb | |
parent | 66c0fdeb65c19d267bd501550e60cd16d7bb4901 (diff) | |
download | chef-0fb79f0a5f8d2c8ca1f9ddb0d0b0267b300dc81f.tar.gz |
chef-client => Chef::Dist::CLIENT
Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
Diffstat (limited to 'spec/functional/resource/windows_task_spec.rb')
-rw-r--r-- | spec/functional/resource/windows_task_spec.rb | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/spec/functional/resource/windows_task_spec.rb b/spec/functional/resource/windows_task_spec.rb index b0c6998d77..b1f839550f 100644 --- a/spec/functional/resource/windows_task_spec.rb +++ b/spec/functional/resource/windows_task_spec.rb @@ -18,6 +18,7 @@ require "spec_helper" require "chef/provider/windows_task" +require "chef/dist" describe Chef::Resource::WindowsTask, :windows_only do # resource.task.application_name will default to task_name unless resource.command is set @@ -45,37 +46,37 @@ describe Chef::Resource::WindowsTask, :windows_only do context "With Arguments" do it "creates scheduled task and sets command arguments" do - subject.command "chef-client -W" + subject.command "#{Chef::Dist::CLIENT} -W" 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("chef-client") + expect(current_resource.task.application_name).to eq(Chef::Dist::CLIENT) expect(current_resource.task.parameters).to eq("-W") end it "does not converge the resource if it is already converged" do - subject.command "chef-client -W" + subject.command "#{Chef::Dist::CLIENT} -W" subject.run_action(:create) - subject.command "chef-client -W" + subject.command "#{Chef::Dist::CLIENT} -W" subject.run_action(:create) expect(subject).not_to be_updated_by_last_action end it "creates scheduled task and sets command arguments when arguments inclusive single quotes" do - subject.command "chef-client -W -L 'C:\\chef\\chef-ad-join.log'" + subject.command "#{Chef::Dist::CLIENT} -W -L 'C:\\chef\\chef-ad-join.log'" 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("chef-client") + expect(current_resource.task.application_name).to eq(Chef::Dist::CLIENT) expect(current_resource.task.parameters).to eq("-W -L 'C:\\chef\\chef-ad-join.log'") 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.command "#{Chef::Dist::CLIENT} -W -L 'C:\\chef\\chef-ad-join.log'" subject.run_action(:create) - subject.command "chef-client -W -L 'C:\\chef\\chef-ad-join.log'" + subject.command "#{Chef::Dist::CLIENT} -W -L 'C:\\chef\\chef-ad-join.log'" subject.run_action(:create) expect(subject).not_to be_updated_by_last_action end @@ -135,19 +136,19 @@ describe Chef::Resource::WindowsTask, :windows_only do context "Without Arguments" do it "creates scheduled task and sets command arguments" do - subject.command "chef-client" + subject.command Chef::Dist::CLIENT 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("chef-client") + expect(current_resource.task.application_name).to eq(Chef::Dist::CLIENT) expect(current_resource.task.parameters).to be_empty end it "does not converge the resource if it is already converged" do - subject.command "chef-client" + subject.command Chef::Dist::CLIENT subject.run_action(:create) - subject.command "chef-client" + subject.command Chef::Dist::CLIENT subject.run_action(:create) expect(subject).not_to be_updated_by_last_action end |