summaryrefslogtreecommitdiff
path: root/spec/functional/resource
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-11-11 17:41:12 -0800
committerGitHub <noreply@github.com>2020-11-11 17:41:12 -0800
commitea6d2b9f92d57d00673d22930007c9d5e8c9e754 (patch)
tree5c25f8baaeb3230ab4d006f87b3f5a8dc4e4a3fb /spec/functional/resource
parenta734171a38e3381814572715966dd772caf19c0e (diff)
parent7360fd6b7f188440d417948f592e0865b8ebe6b6 (diff)
downloadchef-ea6d2b9f92d57d00673d22930007c9d5e8c9e754.tar.gz
Merge pull request #10631 from chef/lcg/zypper-fix
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/functional/resource')
-rw-r--r--spec/functional/resource/zypper_package_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/functional/resource/zypper_package_spec.rb b/spec/functional/resource/zypper_package_spec.rb
index e56684b6f8..ce6a3bf33c 100644
--- a/spec/functional/resource/zypper_package_spec.rb
+++ b/spec/functional/resource/zypper_package_spec.rb
@@ -96,6 +96,17 @@ describe Chef::Resource::ZypperPackage, :requires_root, :suse_only do
expect(zypper_package.updated_by_last_action?).to be false
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
end
+
+ it "multipackage installs which result in nils from the superclass" do
+ # this looks weird, it tests an internal condition of the allow_nils behavior where the arrays passed to install_package will have
+ # nil values, and ensures that doesn't wind up creating weirdness in the resulting shell_out that causes it to fail
+ preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
+ zypper_package.package_name(%w{chef_rpm chef_rpm})
+ zypper_package.version(["1.2", "1.10"])
+ zypper_package.run_action(:install)
+ expect(zypper_package.updated_by_last_action?).to be true
+ expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
+ end
end
context "with versions" do