summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorLamont Granquist <lamont@getchef.com>2019-04-29 11:35:59 -0700
committerGitHub <noreply@github.com>2019-04-29 11:35:59 -0700
commitf2707fcd07d4a906008da9f3891e6e0829605367 (patch)
tree3648295f678661ebeb3961121cd6005e1f669645 /spec/functional
parentb3e8019c540af3be4634c4c76edeba47d67fa6f0 (diff)
parent0fb79f0a5f8d2c8ca1f9ddb0d0b0267b300dc81f (diff)
downloadchef-f2707fcd07d4a906008da9f3891e6e0829605367.tar.gz
Merge pull request #8418 from cc-build/bulk_distro_constant
"chef-client" => #{Chef::Dist::CLIENT}
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/resource/windows_task_spec.rb25
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 b0ba1f9168..fa51ad3f8a 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