diff options
author | Adam Edwards <adamed@opscode.com> | 2014-03-28 00:13:42 -0700 |
---|---|---|
committer | Adam Edwards <adamed@opscode.com> | 2014-03-29 00:21:10 -0700 |
commit | b57795c468a366ff8d755e22f1364c10a5d27af9 (patch) | |
tree | 874a6ee7b89d17d0f4c40bece399ff538e98c850 /spec/unit/resource_spec.rb | |
parent | a8e083a2503c5c81d944f584921628981bad8f9e (diff) | |
download | chef-b57795c468a366ff8d755e22f1364c10a5d27af9.tar.gz |
CR feedback: use expect to explicitly test exception behavior
Diffstat (limited to 'spec/unit/resource_spec.rb')
-rw-r--r-- | spec/unit/resource_spec.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 911d234d1d..734d92db42 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -534,17 +534,11 @@ describe Chef::Resource do end it "should raise Chef::Exceptions::ValidationFailed on an attempt to set the guard_interpreter attribute to something other than a Symbol" do - begin - resource.guard_interpreter('command_dot_com') - rescue Chef::Exceptions::ValidationFailed - end + expect { resource.guard_interpreter('command_dot_com') }.to raise_error(Chef::Exceptions::ValidationFailed) end it "should not raise an exception when setting the guard interpreter attribute to a Symbol" do - begin - resource.guard_interpreter(:command_dot_com) - rescue Chef::Exceptions::ValidationFailed - end + expect { resource.guard_interpreter(:command_dot_com) }.not_to raise_error end end |