fix inconsistencies in README
[puppet-modules/puppetlabs-apt.git] / spec / spec_helper_acceptance.rb
index 7391d211ccf030f3f9d8fc32561f6e14acabeab5..e9d51bfd11c60c4d38b5861b29a9ffefd6a1169f 100644 (file)
@@ -15,7 +15,7 @@ install_bolt_on(hosts) unless pe_install?
 install_module_on(hosts)
 install_module_dependencies_on(hosts)
 
-UNSUPPORTED_PLATFORMS = ['RedHat','Suse','windows','AIX','Solaris']
+UNSUPPORTED_PLATFORMS = %w[RedHat Suse windows AIX Solaris].freeze
 
 DEFAULT_PASSWORD = if default[:hypervisor] == 'vagrant'
                      'vagrant'
@@ -70,7 +70,7 @@ def retry_on_error_matching(max_retry_count = 3, retry_wait_interval_secs = 5, e
     try += 1
     yield
   rescue Exception => e
-    if try < max_retry_count && (error_matcher == nil || e.message =~ error_matcher)
+    if try < max_retry_count && (error_matcher.nil? || e.message =~ error_matcher)
       sleep retry_wait_interval_secs
       retry
     else
@@ -88,6 +88,6 @@ RSpec.configure do |c|
 
   # Configure all nodes in nodeset
   c.before :suite do
-    run_puppet_access_login(user: 'admin') if pe_install?
+    run_puppet_access_login(user: 'admin') if pe_install? && puppet_version =~ %r{(5\.\d\.\d)}
   end
 end