X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fspec_helper_acceptance.rb;h=67bf096d830ae1c1b6449edf69773ca0a897772b;hb=4ea96b8d7ec3dd0d6acabb1d7718f96b8def614c;hp=7391d211ccf030f3f9d8fc32561f6e14acabeab5;hpb=27e46c1f2cd010810899abeb12d58a87a6cc8985;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 7391d21..67bf096 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -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' @@ -69,25 +69,21 @@ 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 # 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