# frozen_string_literal: true require 'spec_helper' describe 'profiles::replace_ca_cert' do pi = { supported_os: [ { 'operatingsystem' => 'Debian', 'operatingsystemrelease' => ['9.4'], }, ], } most = { supported_os: [ { 'operatingsystem' => 'Ubuntu', 'operatingsystemrelease' => ['18.04', '20.04', '22.04'], }, { 'operatingsystem' => 'CentOS', 'operatingsystemrelease' => ['7'], }, ], } context 'All tests' do on_supported_os.each do |_os, os_facts| let(:facts) do os_facts end it { is_expected.to compile.with_all_deps } end on_supported_os(pi).each do |_os, os_facts| let(:facts) do os_facts end it { is_expected.to contain_file('/var/lib/puppet/ssl/certs/ca.pem').with( 'ensure' => 'file', 'replace' => 'yes', ) } end on_supported_os(most).each do |_os, os_facts| let(:facts) do os_facts end it { is_expected.to contain_file('/etc/puppetlabs/puppet/ssl/certs/ca.pem').with( 'ensure' => 'file', 'replace' => 'yes', ) } end end end