summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-05-04 10:34:57 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2021-05-04 10:34:57 -0700
commit5ff105979452421f137a91262ddf801be7ddcdfa (patch)
treed4f7351cc66c092343de8326ddb954a6967736bf
parente8f006f7aee4d5dd768df6306fdf48727f6fcaf3 (diff)
downloadchef-5ff105979452421f137a91262ddf801be7ddcdfa.tar.gz
Fix yum specs
Reset the singleton instance before starting the test, because singletons. Also better clears up some internal state when the daemon gets reaped Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/provider/package/yum/python_helper.rb1
-rw-r--r--spec/unit/provider/package/yum/python_helper_spec.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/provider/package/yum/python_helper.rb b/lib/chef/provider/package/yum/python_helper.rb
index 86aaf7230a..926efef8f3 100644
--- a/lib/chef/provider/package/yum/python_helper.rb
+++ b/lib/chef/provider/package/yum/python_helper.rb
@@ -76,6 +76,7 @@ class Chef
stderr.close unless stderr.nil?
inpipe.close unless inpipe.nil?
outpipe.close unless outpipe.nil?
+ stdin = stdout = stderr = inpipe = outpipe = wait_thr = nil
end
end
diff --git a/spec/unit/provider/package/yum/python_helper_spec.rb b/spec/unit/provider/package/yum/python_helper_spec.rb
index 39c067d135..b8336a500b 100644
--- a/spec/unit/provider/package/yum/python_helper_spec.rb
+++ b/spec/unit/provider/package/yum/python_helper_spec.rb
@@ -21,6 +21,7 @@ require "spec_helper"
describe Chef::Provider::Package::Yum::PythonHelper do
let(:helper) { Chef::Provider::Package::Yum::PythonHelper.instance }
+ before(:each) { Singleton.__init__(Chef::Provider::Package::Yum::PythonHelper) }
it "propagates stacktraces on stderr from the forked subprocess", :rhel do
allow(helper).to receive(:yum_command).and_return("ruby -e 'raise \"your hands in the air\"'")