lib/onceover/rspec/formatters.rb in onceover-3.21.0 vs lib/onceover/rspec/formatters.rb in onceover-3.22.0

- old
+ new

@@ -264,13 +264,11 @@ # Ensure that the folder exists FileUtils.mkdir_p "#{RSpec.configuration.onceover_tempdir}/parallel" # Dump the notification to a unique file - File.open("#{RSpec.configuration.onceover_tempdir}/parallel/results-#{random_string}.yaml", "w") do |file| - file.write(extract_failures(notification).to_yaml) - end + File.write("#{RSpec.configuration.onceover_tempdir}/parallel/results-#{random_string}.yaml", extract_failures(notification).to_yaml) end def output_results(directory) require 'rspec/core/example' # Read all yaml files @@ -278,10 +276,10 @@ files = Dir["#{directory}/*.yaml"] # Merge data roles = files.reduce({}) do |errs, file| # Read all files and merge them - errs.merge(YAML.load(File.read(file))) {|key, oldval, newval| [oldval, newval].flatten }# rubocop:disable Security/YAMLLoad + errs.merge(YAML.load_file(file)) {|key, oldval, newval| [oldval, newval].flatten } end # Delete files from the disk files.each { |f| File.delete(f) }