diff --git a/Gemfile b/Gemfile index fcf09e13..b1f2216f 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 c7e8f0b7..950b5d86 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 b7eee875..00000000 --- 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