summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/resource/chef_client_scheduled_task_spec.rb14
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