diff options
author | Adam Edwards <adamed@opscode.com> | 2015-03-14 07:37:32 -0700 |
---|---|---|
committer | adamedx <adamed@getchef.com> | 2015-05-23 14:20:19 -0700 |
commit | 071e87dfb1f902a566f83acfcb8000a9106c543d (patch) | |
tree | 075d05696a791e430279309f88004dca5fc39fe4 | |
parent | 92cb65508c198d04fb12e1e99475c80bd8a16c4a (diff) | |
download | chef-071e87dfb1f902a566f83acfcb8000a9106c543d.tar.gz |
powershell_script spec for invalid syntax error handling
-rw-r--r-- | spec/functional/resource/powershell_spec.rb | 6 |
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 |