summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@chef.io>2019-08-07 13:47:58 -0700
committerGitHub <noreply@github.com>2019-08-07 13:47:58 -0700
commit8d7d9d0d5a2dc647e6132cfed93fa6035c65c8ca (patch)
tree1ec46cffefa4e9581b79df17d789e48b81f4efd5 /spec
parentb73feff021c99b98dfad22e56c3026a2eb1c635e (diff)
parentcc5a9963bc109d79ba554ba1638d57cb548d8c0d (diff)
downloadchef-8d7d9d0d5a2dc647e6132cfed93fa6035c65c8ca.tar.gz
zypper_package upgrade action not working (#8462)
zypper_package upgrade action not working
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/provider/package/zypper_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb
index a8ab2a0b37..6b64db2fbf 100644
--- a/spec/unit/provider/package/zypper_spec.rb
+++ b/spec/unit/provider/package/zypper_spec.rb
@@ -112,6 +112,15 @@ describe Chef::Provider::Package::Zypper do
expect(provider.candidate_version).to eql(["1.0"])
end
+ it "should have differing current and candidate versions if zypper detects an upgrade" do
+ status = double(stdout: "Version : 1.0 \nInstalled : Yes \nStatus : out-of-date (version 0.9 installed)", exitstatus: 0)
+
+ allow(provider).to receive(:shell_out_compacted!).and_return(status)
+ provider.load_current_resource
+ expect(provider.get_current_versions).to eq(["0.9"])
+ expect(provider.get_candidate_versions).to eq(["1.0"])
+ end
+
it "should return the current resouce" do
expect(provider.load_current_resource).to eql(current_resource)
end