Commit b57795c4 authored by Adam Edwards's avatar Adam Edwards
Browse files

CR feedback: use expect to explicitly test exception behavior

parent a8e083a2
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment