diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-01-19 07:04:38 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-01-19 07:04:38 -0800 |
commit | 56e047311b35efe99df84b7544f255712423cd0c (patch) | |
tree | 4c1d2644cad5e085e5ec77c3518d6f5c0f48f9ba /spec/functional | |
parent | 6c724e866274a728bc66740ab352db7da7d7958f (diff) | |
download | chef-56e047311b35efe99df84b7544f255712423cd0c.tar.gz |
Added spec for issue #2348jdm/powershell-2348
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/resource/powershell_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/functional/resource/powershell_spec.rb b/spec/functional/resource/powershell_spec.rb index 033f34e256..1b3ac844e0 100644 --- a/spec/functional/resource/powershell_spec.rb +++ b/spec/functional/resource/powershell_spec.rb @@ -56,6 +56,21 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do resource.run_action(:run) end + it "returns the -27 for a powershell script that exits with -27" do + file = Tempfile.new(['foo', '.ps1']) + begin + file.write "exit -27" + file.close + resource.code(". \"#{file.path}\"") + resource.returns(-27) + resource.run_action(:run) + ensure + file.close + file.unlink + end + end + + it "returns the process exit code" do resource.code(arbitrary_nonzero_process_exit_code_content) resource.returns(arbitrary_nonzero_process_exit_code) |