From add4a49b32d5e07bdbfc211cbecdaa5fdee3e460 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Mon, 7 Sep 2020 19:43:32 +0200 Subject: [PATCH] Remove fact memoization This already happens in rspec-puppet-facts itself and there's no reason to duplicate it. There it's also more correct by taking all variables into account. --- lib/voxpupuli/test/spec_helper.rb | 9 --------- voxpupuli-test.gemspec | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/voxpupuli/test/spec_helper.rb b/lib/voxpupuli/test/spec_helper.rb index c47703e..1c23d49 100644 --- a/lib/voxpupuli/test/spec_helper.rb +++ b/lib/voxpupuli/test/spec_helper.rb @@ -27,15 +27,6 @@ def suggest_facter_version require 'voxpupuli/test/facts' require 'puppetlabs_spec_helper/module_spec_helper' -# Generating facts is slow - this memoizes the facts between multiple classes. -# Marshalling is used to get unique instances which helps when tests overrides -# facts. -FACTS_CACHE = {} -def on_supported_os(opts = {}) - result = FACTS_CACHE[opts.to_s] ||= super(opts) - Marshal.load(Marshal.dump(result)) -end - RSpec.configure do |config| config.default_facter_version = suggest_facter_version diff --git a/voxpupuli-test.gemspec b/voxpupuli-test.gemspec index c28d81c..c0eb966 100644 --- a/voxpupuli-test.gemspec +++ b/voxpupuli-test.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'metadata-json-lint' s.add_runtime_dependency 'parallel_tests' s.add_runtime_dependency 'puppetlabs_spec_helper', '>= 2.14.0' - s.add_runtime_dependency 'rspec-puppet-facts', '>= 1.9.5' + s.add_runtime_dependency 'rspec-puppet-facts', '>= 2.0.1', '< 3' s.add_runtime_dependency 'rspec-puppet-utils', '>= 1.9.5' # Rubocop