diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-01-26 10:31:01 -0600 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-01-26 10:31:01 -0600 |
commit | 65031fc65172a99c301177c62963c3dff528fac3 (patch) | |
tree | f70e1645d56f6d8f925510219d453b69e8c9fba8 /spec | |
parent | 9467b30cc1690f566f083d1710fd0436adb8b67b (diff) | |
parent | 56e047311b35efe99df84b7544f255712423cd0c (diff) | |
download | chef-65031fc65172a99c301177c62963c3dff528fac3.tar.gz |
Merge pull request #2774 from chef/jdm/powershell-2348
Fix up powershell script
Diffstat (limited to 'spec')
-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) |