From f2ada39e3b49ca868d54f96accf3321459ea69fc Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 22 Jun 2022 13:58:54 +0200 Subject: [PATCH] Update to voxpupuli-test 5 --- Gemfile | 2 +- spec/spec_helper.rb | 2 ++ spec/support/facts.rb | 27 --------------------------- 3 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 spec/support/facts.rb diff --git a/Gemfile b/Gemfile index fcf09e133..b1f2216ff 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ gem 'puppet-lint-param-docs', '>= 1.3.0', {"groups"=>["test"]} gem 'puppet-lint-spaceship_operator_without_tag-check', {"groups"=>["test"]} gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]} gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]} -gem 'voxpupuli-test', '~> 1.4', {"groups"=>["test"]} +gem 'voxpupuli-test', '~> 5.0', {"groups"=>["test"]} gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]} gem 'puppet_metadata', '~> 1.3' gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]} diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c7e8f0b7f..950b5d869 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,6 +3,8 @@ require 'voxpupuli/test/spec_helper' +add_mocked_facts! + def get_content(subject, title) is_expected.to contain_file(title) content = subject.resource('file', title).send(:parameters)[:content] diff --git a/spec/support/facts.rb b/spec/support/facts.rb deleted file mode 100644 index b7eee8752..000000000 --- a/spec/support/facts.rb +++ /dev/null @@ -1,27 +0,0 @@ -# This fact is provided by puppetlabs-stdlib and uses the actual provider for -# service. A rough conversion of grepping in the puppet source: -# grep defaultfor lib/puppet/provider/service/*.rb -add_custom_fact :service_provider, ->(os, facts) do - case facts[:osfamily].downcase - when 'archlinux' - 'systemd' - when 'darwin' - 'launchd' - when 'debian' - 'systemd' - when 'freebsd' - 'freebsd' - when 'gentoo' - 'openrc' - when 'openbsd' - 'openbsd' - when 'redhat' - facts[:operatingsystemrelease].to_i >= 7 ? 'systemd' : 'redhat' - when 'suse' - facts[:operatingsystemmajrelease].to_i >= 12 ? 'systemd' : 'redhat' - when 'windows' - 'windows' - else - 'init' - end -end