summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-02-02 12:56:48 -0800
committerGitHub <noreply@github.com>2021-02-02 12:56:48 -0800
commit2c203bc41cb6fbd1659dcb12fd506c5d3b31564c (patch)
tree039eccc4854b98738ff744f77bd37111ea6dfa93 /spec
parentf3d2f8c09c70eae8950a044a92ee560028b2aa7b (diff)
parent7a876de6abbd5fe7362f7544974392192845f32d (diff)
downloadchef-2c203bc41cb6fbd1659dcb12fd506c5d3b31564c.tar.gz
Merge pull request #10969 from chef/dnf
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/provider/package/dnf/python_helper_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/unit/provider/package/dnf/python_helper_spec.rb b/spec/unit/provider/package/dnf/python_helper_spec.rb
index 1f94147273..197af4ead6 100644
--- a/spec/unit/provider/package/dnf/python_helper_spec.rb
+++ b/spec/unit/provider/package/dnf/python_helper_spec.rb
@@ -19,11 +19,17 @@ require "spec_helper"
# NOTE: most of the tests of this functionality are baked into the func tests for the dnf package provider
-describe Chef::Provider::Package::Dnf::PythonHelper do
+# run this test only for following platforms.
+exclude_test = !(%w{rhel fedora amazon}.include?(ohai[:platform_family]) && File.exist?("/usr/bin/dnf"))
+describe Chef::Provider::Package::Dnf::PythonHelper, :requires_root, external: exclude_test do
let(:helper) { Chef::Provider::Package::Dnf::PythonHelper.instance }
it "propagates stacktraces on stderr from the forked subprocess", :rhel do
allow(helper).to receive(:dnf_command).and_return("ruby -e 'raise \"your hands in the air\"'")
expect { helper.package_query(:whatprovides, "tcpdump") }.to raise_error(/your hands in the air/)
end
+
+ it "compares EVRAs with dots in the release correctly" do
+ expect(helper.compare_versions("0:1.8.29-6.el8.x86_64", "0:1.8.29-6.el8_3.1.x86_64")).to eql(-1)
+ end
end