Add the FrozenStrings magic comment
[puppet-modules/puppetlabs-apt.git] / spec / acceptance / apt_key_provider_spec.rb
index 3e38a6dc4682c4ab588c7e4916ae80363e0f4cf0..d241603844808717be8b7a8b0b1ca3cc29103b9d 100644 (file)
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 require 'spec_helper_acceptance'
 
 PUPPETLABS_GPG_KEY_SHORT_ID         = 'EF8D349F'.freeze
@@ -888,15 +890,16 @@ describe 'apt_key' do
   end
 
   describe 'refresh' do
-    if os[:family] == 'debian' && (os[:distro][:codename] == 'stretch' || os[:distro][:codename] == 'bionic')
-      # Set Debian Stetch specific value of puppetlabs_exp_check_command
+    if ['8', '14.04', '16.04'].include?(host_inventory['facter']['os']['release']['major'])
+      # older OSes use puppetlabs_exp_check_command
+      let(:puppetlabs_exp_check_command) { PUPPETLABS_EXP_CHECK_COMMAND }
+
+    else
+      # Set Debian Stetch and newer OSes puppetlabs_exp_check_command
       let(:puppetlabs_exp_check_command) { DEBIAN_PUPPETLABS_EXP_CHECK_COMMAND }
 
       # Ensure dirmngr package is installed
       apply_manifest(refresh_check_for_dirmngr_pp, acceptable_exit_codes: [0, 2])
-    else
-      # Set default value of puppetlabs_exp_check_command
-      let(:puppetlabs_exp_check_command) { PUPPETLABS_EXP_CHECK_COMMAND }
     end
     before(:each) do
       # Delete the Puppet Labs Release Key and install an expired version of the key