diff options
author | George Holt <gholtiii@me.com> | 2021-09-09 15:25:01 -0400 |
---|---|---|
committer | George Holt <gholtiii@me.com> | 2021-09-09 15:26:33 -0400 |
commit | b631de23222e034d0254be9b3c0437852c579223 (patch) | |
tree | 545f24a401dc0765fe98e7748e51125263b0d4ab /spec/unit/resource | |
parent | 813869f9aadf2445c115f9f4c01ddb029eb93840 (diff) | |
download | chef-b631de23222e034d0254be9b3c0437852c579223.tar.gz |
[chef-client] Enable chef_client_scheduled_task resource to leverage the windows_task priority property to boost chef-client spawned processes
Signed-off-by: George Holt <gholtiii@me.com>
Diffstat (limited to 'spec/unit/resource')
-rw-r--r-- | spec/unit/resource/chef_client_scheduled_task_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/resource/chef_client_scheduled_task_spec.rb b/spec/unit/resource/chef_client_scheduled_task_spec.rb index b3c663cdae..0acc268a10 100644 --- a/spec/unit/resource/chef_client_scheduled_task_spec.rb +++ b/spec/unit/resource/chef_client_scheduled_task_spec.rb @@ -73,6 +73,20 @@ describe Chef::Resource::ChefClientScheduledTask do expect(resource.chef_binary_path).to eql("C:/opscode/chef/bin/chef-client") end + context "priority" do + it "default value is 7" do + expect(resource.priority).to eq(7) + end + + it "raise error when priority value less than 0" do + expect { resource.priority(-1) }.to raise_error(Chef::Exceptions::ValidationFailed, "Option priority's value -1 should be in range of 0 to 10!") + end + + it "raise error when priority values is greater than 10" do + expect { resource.priority 11 }.to raise_error(Chef::Exceptions::ValidationFailed, "Option priority's value 11 should be in range of 0 to 10!") + end + end + it "supports :add and :remove actions" do expect { resource.action :add }.not_to raise_error expect { resource.action :remove }.not_to raise_error |