summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2016-02-29 13:25:24 -0800
committerMatt Wrock <matt@mattwrock.com>2016-02-29 14:33:47 -0800
commit89e333a27dd5cbecd205405046bafe13d6f05563 (patch)
tree82919b87bfa7b0d51d6245d63bfacee9179da491
parent5533dbb2917860dca16765d49079ed01a421fad8 (diff)
downloadchef-msi.tar.gz
fixes #4639 and returns true from define_resource_requirements for MSIsmsi
-rw-r--r--lib/chef/provider/package/windows.rb2
-rw-r--r--spec/unit/provider/package/windows_spec.rb9
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/chef/provider/package/windows.rb b/lib/chef/provider/package/windows.rb
index 9772a087bb..02137a5525 100644
--- a/lib/chef/provider/package/windows.rb
+++ b/lib/chef/provider/package/windows.rb
@@ -36,7 +36,7 @@ class Chef
def define_resource_requirements
requirements.assert(:install) do |a|
- a.assertion { new_resource.source unless msi? }
+ a.assertion { new_resource.source || msi? }
a.failure_message Chef::Exceptions::NoWindowsPackageSource, "Source for package #{new_resource.name} must be specified in the resource's source property for package to be installed because the package_name property is used to test for the package installation state for this package type."
end
end
diff --git a/spec/unit/provider/package/windows_spec.rb b/spec/unit/provider/package/windows_spec.rb
index 334b258a26..e26662ac75 100644
--- a/spec/unit/provider/package/windows_spec.rb
+++ b/spec/unit/provider/package/windows_spec.rb
@@ -296,6 +296,15 @@ describe Chef::Provider::Package::Windows, :windows_only do
it "raises a NoWindowsPackageSource error" do
expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::NoWindowsPackageSource)
end
+
+ context "msi installer_type" do
+ let(:installer_type) { :msi }
+
+ it "does not raise a NoWindowsPackageSource error" do
+ expect(provider).to receive(:install_package)
+ provider.run_action(:install)
+ end
+ end
end
context "http source given and no type given explicitly" do