diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2021-11-11 14:58:10 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2021-11-11 14:58:10 -0800 |
commit | ee5a1d5b06f4ba39bc043d9a482a325f9680fa95 (patch) | |
tree | 452c71608f49d6b4e552d44dbd776b50b7433f82 | |
parent | c3a8008132c58ec3e4746d16346939bb2f2cd5d7 (diff) | |
download | chef-ee5a1d5b06f4ba39bc043d9a482a325f9680fa95.tar.gz |
Add test for zypper_package remove with no installed or candidate
version
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | spec/functional/resource/zypper_package_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/functional/resource/zypper_package_spec.rb b/spec/functional/resource/zypper_package_spec.rb index ce6a3bf33c..3d3a1db786 100644 --- a/spec/functional/resource/zypper_package_spec.rb +++ b/spec/functional/resource/zypper_package_spec.rb @@ -187,6 +187,13 @@ describe Chef::Resource::ZypperPackage, :requires_root, :suse_only do 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("^package chef_rpm is not installed$") end + + it "is idempotent when a package isn't installed" do + FileUtils.rm_f "/etc/zypp/repos.d/chef-zypp-localtesting.repo" + zypper_package.run_action(:remove) + 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("^package chef_rpm is not installed$") + end end end |