pdksync_heads/master-0-g34e3266
[puppet-modules/puppetlabs-apt.git] / spec / spec_helper_acceptance.rb
index e9d51bfd11c60c4d38b5861b29a9ffefd6a1169f..258116c5629d4b5bddd33958cc3552fd22027cda 100644 (file)
@@ -15,7 +15,7 @@ install_bolt_on(hosts) unless pe_install?
 install_module_on(hosts)
 install_module_dependencies_on(hosts)
 
-UNSUPPORTED_PLATFORMS = %w[RedHat Suse windows AIX Solaris].freeze
+UNSUPPORTED_PLATFORMS = ['RedHat', 'Suse', 'windows', 'AIX', 'Solaris'].freeze
 
 DEFAULT_PASSWORD = if default[:hypervisor] == 'vagrant'
                      'vagrant'
@@ -27,7 +27,8 @@ def puppet_version
   (on default, puppet('--version')).output.chomp
 end
 
-def run_puppet_access_login(user:, password: '~!@#$%^*-/ aZ', lifetime: '5y')
+def run_puppet_access_login(user:, password:
+                            '~!@#$%^*-/ aZ', lifetime: '5y')
   on(master, puppet('access', 'login', '--username', user, '--lifetime', lifetime), stdin: password)
 end
 
@@ -69,19 +70,15 @@ def retry_on_error_matching(max_retry_count = 3, retry_wait_interval_secs = 5, e
   begin
     try += 1
     yield
-  rescue Exception => e
-    if try < max_retry_count && (error_matcher.nil? || e.message =~ error_matcher)
-      sleep retry_wait_interval_secs
-      retry
-    else
-      raise
-    end
+  rescue StandardError => e
+    raise unless try < max_retry_count && (error_matcher.nil? || e.message =~ error_matcher)
+    sleep retry_wait_interval_secs
+    retry
   end
 end
 
 RSpec.configure do |c|
-  # Project root
-  proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+  File.expand_path(File.join(File.dirname(__FILE__), '..'))
 
   # Readable test descriptions
   c.formatter = :documentation