summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2014-09-25 16:11:00 -0400
committerBryan McLellan <btm@loftninjas.org>2014-09-30 20:13:30 -0400
commitb04c9a5c515fb07317c00a3fbc9a657b58f26930 (patch)
tree4f6c30eaa46bbb41d271456820b9aea0ea42f04f
parent4c544937dbb80fe2e74ccd4054ee328569aad6b3 (diff)
downloadchef-b04c9a5c515fb07317c00a3fbc9a657b58f26930.tar.gz
test guard_interpreter order
adds a functional test to ensure guard_interpreter can be set after a conditional.
-rw-r--r--spec/functional/resource/powershell_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/functional/resource/powershell_spec.rb b/spec/functional/resource/powershell_spec.rb
index 06470a27d4..a18ce3a0fd 100644
--- a/spec/functional/resource/powershell_spec.rb
+++ b/spec/functional/resource/powershell_spec.rb
@@ -236,6 +236,19 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
resource.should_skip?(:run).should be_true
end
+ context "the only_if is specified before the guard" do
+ before do
+ # force the guard_interpreter to :default in case the default changes later
+ resource.guard_interpreter :default
+ end
+
+ it "evaluates a powershell $true for a only_if block as true" do
+ resource.only_if "$true"
+ resource.guard_interpreter :powershell_script
+ resource.should_skip?(:run).should be_false
+ end
+ end
+
context "with powershell_script as the guard_interpreter" do
before(:each) do
resource.guard_interpreter :powershell_script