summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
[