summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Edwards <adamed@opscode.com>2014-10-23 05:50:31 -0700
committerAdam Edwards <adamed@opscode.com>2014-10-23 10:43:08 -0700
commitb50af7cb44278fc8a9c9c653360d0810ce59efc7 (patch)
treee626643f219104c07ca879c557623796175a3d7e
parent895f331a0076020968de7ff8c0440c04f931b4d8 (diff)
downloadchef-b50af7cb44278fc8a9c9c653360d0810ce59efc7.tar.gz
windows_script specs for guard_interpreter exception behavior on ruby blocks
-rw-r--r--spec/support/shared/unit/windows_script_resource.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/shared/unit/windows_script_resource.rb b/spec/support/shared/unit/windows_script_resource.rb
index b4a5889b32..888ad600c5 100644
--- a/spec/support/shared/unit/windows_script_resource.rb
+++ b/spec/support/shared/unit/windows_script_resource.rb
@@ -54,6 +54,19 @@ shared_examples_for "a Windows script resource" do
@resource.only_if 'echo hi'
@resource.should_skip?(:run).should == nil
end
+
+ describe "when the guard is given a ruby block" do
+ it "should evaluate the guard if the guard_interpreter is set to its default value" do
+ @resource.only_if { true }
+ @resource.should_skip?(:run).should == nil
+ end
+
+ it "should raise an exception if the guard_interpreter is overridden from its default value" do
+ @resource.guard_interpreter :bash
+ @resource.only_if { true }
+ expect { @resource.should_skip?(:run) }.to raise_error
+ end
+ end
end
context "script with a default guard interpreter" do