diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-03-23 13:28:51 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-03-23 13:28:51 -0700 |
commit | 6932faa7fd7087dc7c7c16ff6423d8b42c4b701a (patch) | |
tree | cceda7fcf610c7b40f396d554980fa60ae9fc90b /spec/functional | |
parent | 2bdbd46f8034bf0ef7939a735e62e4acc5657703 (diff) | |
download | chef-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.rb | 11 |
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 |