summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/functional/resource/msu_package_spec.rb7
-rw-r--r--spec/unit/resource/msu_package_spec.rb4
2 files changed, 9 insertions, 2 deletions
diff --git a/spec/functional/resource/msu_package_spec.rb b/spec/functional/resource/msu_package_spec.rb
index 0609c8d6ea..1161049571 100644
--- a/spec/functional/resource/msu_package_spec.rb
+++ b/spec/functional/resource/msu_package_spec.rb
@@ -23,6 +23,8 @@ describe Chef::Resource::MsuPackage, :win2012r2_only do
let(:package_name) { "Package_for_KB2959977" }
let(:package_source) { "https://download.microsoft.com/download/3/B/3/3B320C07-B7B1-41E5-81F4-79EBC02DF7D3/Windows8.1-KB2959977-x64.msu" }
+ let(:package_identity) { "Package_for_KB2959977~31bf3856ad364e35~amd64~~6.3.1.1" }
+ let(:timeout) { 3600 }
let(:new_resource) { Chef::Resource::CabPackage.new("windows_test_pkg") }
let(:cab_provider) do
@@ -36,6 +38,7 @@ describe Chef::Resource::MsuPackage, :win2012r2_only do
new_resource = Chef::Resource::MsuPackage.new("test msu package", run_context)
new_resource.package_name package_name
new_resource.source package_source
+ new_resource.timeout timeout
new_resource
end
@@ -44,7 +47,7 @@ describe Chef::Resource::MsuPackage, :win2012r2_only do
it "installs the package successfully" do
subject.run_action(:install)
- found_packages = cab_provider.installed_packages.select { |p| p["package_identity"] =~ /^#{package_name}~/ }
+ found_packages = cab_provider.installed_packages.select { |p| p["package_identity"] == package_identity }
expect(found_packages.length).to be == 1
end
end
@@ -53,7 +56,7 @@ describe Chef::Resource::MsuPackage, :win2012r2_only do
it "removes an installed package" do
subject.run_action(:install)
remove_package
- found_packages = cab_provider.installed_packages.select { |p| p["package_identity"] =~ /^#{package_name}~/ }
+ found_packages = cab_provider.installed_packages.select { |p| p["package_identity"] == package_identity }
expect(found_packages.length).to be == 0
end
end
diff --git a/spec/unit/resource/msu_package_spec.rb b/spec/unit/resource/msu_package_spec.rb
index 49fe61b7b9..3c7462a1a7 100644
--- a/spec/unit/resource/msu_package_spec.rb
+++ b/spec/unit/resource/msu_package_spec.rb
@@ -60,4 +60,8 @@ describe Chef::Resource::MsuPackage do
resource.source("package.msu")
expect(resource.source).not_to eq("package.msu")
end
+
+ it "sets timeout property to 3600 by default" do
+ expect(resource.timeout).to eql(3600)
+ end
end