diff options
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/resource/conditional/guard_interpreter_spec.rb | 6 | ||||
-rw-r--r-- | spec/unit/resource_spec.rb | 10 |
2 files changed, 3 insertions, 13 deletions
diff --git a/spec/unit/resource/conditional/guard_interpreter_spec.rb b/spec/unit/resource/conditional/guard_interpreter_spec.rb index 3cf64b98a0..3f49e341dc 100644 --- a/spec/unit/resource/conditional/guard_interpreter_spec.rb +++ b/spec/unit/resource/conditional/guard_interpreter_spec.rb @@ -49,11 +49,7 @@ describe Chef::Resource::Conditional::GuardInterpreter do it "should raise an exception if guard_interpreter is set to a resource not derived from Chef::Resource::Script" do resource.guard_interpreter(:file) - - begin - resource.only_if("echo hi").should raise_error ArgumentError - rescue ArgumentError - end + expect { resource.only_if("echo hi") }.to raise_error ArgumentError end end end 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 |