summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordheerajd-msys <dheeraj.dubey@msystechnologies.com>2016-09-06 14:17:55 +0530
committerdheerajd-msys <dheeraj.dubey@msystechnologies.com>2016-09-06 17:09:16 +0530
commitae1f3c95e3cfcf352071b56487877bfce2037e8a (patch)
tree58a49aa47cfc8a5a01f287ca3b6febb4f8bcbbfb
parent593f2742e83e2bd5338594f37ba8d6658463bdda (diff)
downloadchef-ae1f3c95e3cfcf352071b56487877bfce2037e8a.tar.gz
Added spec for Timeout function in Windows remove package code
-rw-r--r--spec/unit/provider/package/windows/exe_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/provider/package/windows/exe_spec.rb b/spec/unit/provider/package/windows/exe_spec.rb
index b514f80a35..f18cbf3dca 100644
--- a/spec/unit/provider/package/windows/exe_spec.rb
+++ b/spec/unit/provider/package/windows/exe_spec.rb
@@ -122,6 +122,15 @@ describe Chef::Provider::Package::Windows::Exe do
end
end
+ context "When timeout value is passed" do
+ it "removes installed package and quotes uninstall string" do
+ new_resource.timeout = 300
+ allow(::File).to receive(:exist?).with("uninst_dir/uninst_file").and_return(true)
+ expect(provider).to receive(:shell_out!).with(/start \"\" \/wait \"uninst_dir\/uninst_file\" \/S \/NCRC & exit %%%%ERRORLEVEL%%%%/, :timeout => 300, :returns => [0])
+ provider.remove_package
+ end
+ end
+
context "several packages installed with quoted uninstall strings" do
let(:uninstall_hash) do
[