diff options
author | Bryan McLellan <btm@loftninjas.org> | 2014-09-25 13:18:18 -0400 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2014-09-25 13:18:18 -0400 |
commit | 6380c08c6b749e22e7ad64d3b9eddb242bc419ec (patch) | |
tree | 74d530df2f2e20e770d74b4ef5d2c812e595796f /spec/functional/resource/powershell_spec.rb | |
parent | 36ef8cb1ed42357af1358821adace1b58773c099 (diff) | |
download | chef-btm/guard-exception.tar.gz |
update functional tests for guard_interpreterbtm/guard-exception
we now raise an error when passed a block and a guard_interpreter is
specified other than :default. When other interpreters become the "default"
(which actually means use the default shell for that platform) we will
need to consider those as well, i.e. #1495.
Diffstat (limited to 'spec/functional/resource/powershell_spec.rb')
-rw-r--r-- | spec/functional/resource/powershell_spec.rb | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/spec/functional/resource/powershell_spec.rb b/spec/functional/resource/powershell_spec.rb index 5001e870a9..c30c710959 100644 --- a/spec/functional/resource/powershell_spec.rb +++ b/spec/functional/resource/powershell_spec.rb @@ -162,6 +162,12 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do resource.returns(0) resource.run_action(:run) end + + it "raises an error when given a block and a guard_interpreter" do + resource.guard_interpreter :sh + expect { resource.only_if { true } }.to raise_error(ArgumentError, /guard_interpreter does not support blocks/) + end + end context "when running on a 32-bit version of Windows", :windows32_only do @@ -265,26 +271,6 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do resource.should_skip?(:run).should be_false end - it "evaluates a not_if block as false" do - resource.not_if { false } - resource.should_skip?(:run).should be_false - end - - it "evaluates a not_if block as true" do - resource.not_if { true } - resource.should_skip?(:run).should be_true - end - - it "evaluates an only_if block as false" do - resource.only_if { false } - resource.should_skip?(:run).should be_true - end - - it "evaluates an only_if block as true" do - resource.only_if { true } - resource.should_skip?(:run).should be_false - end - it "evaluates a non-zero powershell exit status for not_if as true" do resource.not_if "exit 37" resource.should_skip?(:run).should be_false |