diff options
author | Adam Edwards <adamed@opscode.com> | 2015-03-14 07:37:32 -0700 |
---|---|---|
committer | adamedx <adamed@getchef.com> | 2015-04-24 20:36:27 -0700 |
commit | a171b0c9d277dfd6abc6718087803668e754746d (patch) | |
tree | 8e8d02457bcbd0828495ed5f73848533153a6f52 | |
parent | 391c9a62143e43a623cdbebbf6f460653b66e94d (diff) | |
download | chef-a171b0c9d277dfd6abc6718087803668e754746d.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 |