summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2016-05-31 18:13:48 +0100
committerThom May <thom@may.lt>2016-05-31 18:13:48 +0100
commitf5e9f42b30fc2207ed7b722bf459169c92f0da21 (patch)
tree6898a1b0637d279c6f41c01868d30a204dc47f4d /spec
parent6354cb4c5e37444c830c6d80eeb3b8f421be8359 (diff)
parent183aa233381ea84c98976baadb90bb782a141f75 (diff)
downloadchef-f5e9f42b30fc2207ed7b722bf459169c92f0da21.tar.gz
Merge pull request #4966 from crigor/ebuild-version-character
Fix portage provider to support version with character
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/provider/package/portage_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/provider/package/portage_spec.rb b/spec/unit/provider/package/portage_spec.rb
index c2ff1cc952..ebb5b3139f 100644
--- a/spec/unit/provider/package/portage_spec.rb
+++ b/spec/unit/provider/package/portage_spec.rb
@@ -56,6 +56,12 @@ describe Chef::Provider::Package::Portage, "load_current_resource" do
expect(@provider.current_resource.version).to eq("1.0.0-r1")
end
+ it "should return a current resource with the correct version if the package is found with version with character" do
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0d"])
+ @provider.load_current_resource
+ expect(@provider.current_resource.version).to eq("1.0.0d")
+ end
+
it "should return a current resource with a nil version if the package is not found" do
allow(::Dir).to receive(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/notgit-1.0.0"])
@provider.load_current_resource