Switch to Facter.flush

Facter.clear clears all cached values and removes all facts from memory
where Facter.flush just clears the cached values. This should reduce the
time it takes to actually run the unit tests as it all the other facts
we're touching won't be removed from memory.

Also we only need to do it before the tests, not before and after.

Change-Id: I9a24dc9f74cb3b59508b12e63a078068c26c1442
This commit is contained in:
Alex Schultz
2017-12-22 15:11:34 -07:00
parent e5005dc4ff
commit b5bd19a630
3 changed files with 3 additions and 6 deletions

View File

@@ -2,8 +2,7 @@ require 'spec_helper'
describe 'os_workers_large' do
before { Facter.clear }
after { Facter.clear }
before { Facter.flush }
context 'with processorcount=1' do
before do

View File

@@ -2,8 +2,7 @@ require 'spec_helper'
describe 'os_workers_small' do
before { Facter.clear }
after { Facter.clear }
before { Facter.flush }
context 'with processorcount=1' do
before do

View File

@@ -2,8 +2,7 @@ require 'spec_helper'
describe 'os_workers' do
before { Facter.clear }
after { Facter.clear }
before { Facter.flush }
context 'with processorcount=1' do
before do