summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-03-23 13:28:51 -0700
committerTim Smith <tsmith84@gmail.com>2020-03-23 13:28:51 -0700
commit6932faa7fd7087dc7c7c16ff6423d8b42c4b701a (patch)
treecceda7fcf610c7b40f396d554980fa60ae9fc90b /spec/functional
parent2bdbd46f8034bf0ef7939a735e62e4acc5657703 (diff)
downloadchef-6932faa7fd7087dc7c7c16ff6423d8b42c4b701a.tar.gz
Update the cron functional tests for the new error
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/resource/cron_spec.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/spec/functional/resource/cron_spec.rb b/spec/functional/resource/cron_spec.rb
index d4568e25cb..ab4fa4b4d9 100644
--- a/spec/functional/resource/cron_spec.rb
+++ b/spec/functional/resource/cron_spec.rb
@@ -152,19 +152,16 @@ describe Chef::Resource::Cron, :requires_root, :unix_only do
new_resource.run_action(:delete)
end
- def cron_create_should_raise_exception
- expect { new_resource.run_action(:create) }.to raise_error(Chef::Exceptions::Cron)
- cron_should_not_exists(new_resource.name)
- end
-
it "should not create cron with invalid minute" do
new_resource.minute "invalid"
- cron_create_should_raise_exception
+ expect { new_resource.run_action(:create) }.to raise_error(Chef::Exceptions::ValidationFailed)
+ cron_should_not_exists(new_resource.name)
end
it "should not create cron with invalid user" do
new_resource.user "1-really-really-invalid-user-name"
- cron_create_should_raise_exception
+ expect { new_resource.run_action(:create) }.to raise_error(Chef::Exceptions::Cron)
+ cron_should_not_exists(new_resource.name)
end
end