From 315dc1ecb449651331ac4142215d6217f76c37ca Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 7 May 2021 20:51:11 -0700 Subject: Really fix the DNF spec tests The rspec expectation is remaining attached to the singleton Signed-off-by: Lamont Granquist --- spec/unit/provider/package/dnf/python_helper_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/provider/package/dnf/python_helper_spec.rb b/spec/unit/provider/package/dnf/python_helper_spec.rb index 7d55d01698..fb84cdddf9 100644 --- a/spec/unit/provider/package/dnf/python_helper_spec.rb +++ b/spec/unit/provider/package/dnf/python_helper_spec.rb @@ -23,9 +23,9 @@ require "spec_helper" 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 } + before(:each) { Singleton.__init__(Chef::Provider::Package::Dnf::PythonHelper) } it "propagates stacktraces on stderr from the forked subprocess", :rhel do - Singleton.__init__(Chef::Provider::Package::Dnf::PythonHelper) 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 -- cgit v1.2.1