summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Edwards <adamed@opscode.com>2015-03-14 07:37:32 -0700
committerKartik Null Cating-Subramanian <ksubramanian@chef.io>2015-05-29 16:58:55 -0400
commitdfb7a0f63f507daabe6fac8d96c85206558b754d (patch)
tree7904c874af52bb696ff390e15197db65c65c03a7
parent0594046ea04be724556fcaa12d76534fbc099a42 (diff)
downloadchef-dfb7a0f63f507daabe6fac8d96c85206558b754d.tar.gz
powershell_script spec for invalid syntax error handling
-rw-r--r--spec/functional/resource/powershell_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/functional/resource/powershell_spec.rb b/spec/functional/resource/powershell_spec.rb
index 56a905efe7..7adff0da05 100644
--- a/spec/functional/resource/powershell_spec.rb
+++ b/spec/functional/resource/powershell_spec.rb
@@ -102,6 +102,12 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
resource.run_action(:run)
end
+ it "returns 1 if the script provided to the code attribute is not syntactically correct" do
+ resource.code('if({)')
+ resource.returns(1)
+ resource.run_action(:run)
+ end
+
# This somewhat ambiguous case, two failures of different types,
# seems to violate the principle of returning the status of the
# last line executed -- in this case, we return the status of the