diff options
Diffstat (limited to 'spec/unit/resource/conditional_spec.rb')
-rw-r--r-- | spec/unit/resource/conditional_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/resource/conditional_spec.rb b/spec/unit/resource/conditional_spec.rb index 4df185bcd6..92ca53118b 100644 --- a/spec/unit/resource/conditional_spec.rb +++ b/spec/unit/resource/conditional_spec.rb @@ -27,6 +27,15 @@ describe Chef::Resource::Conditional do @parent_resource = Chef::Resource.new(nil, Chef::Node.new) end + it "raises an exception when a guard_interpreter is specified and a block is given" do + @parent_resource.guard_interpreter :canadian_mounties + expect { Chef::Resource::Conditional.send(:new, :always, @parent_resource, nil, {}) { True } }.to raise_error(ArgumentError, /does not support blocks/) + end + + it "raises an exception when neither a block or command is given" do + expect { Chef::Resource::Conditional.send(:new, :always, @parent_resource, nil, {})}.to raise_error(ArgumentError, /requires either a command or a block/) + end + describe "when created as an `only_if`" do describe "after running a successful command" do before do |