class Hydra::Listener::ReportGenerator

Output a textual report at the end of testing

Public Instance Methods

file_begin(file) click to toggle source

Log the start time of a file

# File lib/hydra/listener/report_generator.rb, line 11
def file_begin(file)
  @report[file] ||= { }
  @report[file]['start'] = Time.now.to_f
end
file_end(file, output) click to toggle source

Log the end time of a file and compute the file's testing duration

# File lib/hydra/listener/report_generator.rb, line 18
def file_end(file, output)
  @report[file]['end'] = Time.now.to_f
  @report[file]['duration'] = @report[file]['end'] - @report[file]['start']
  @report[file]['all_tests_passed_last_run'] = (output == '.')
end
testing_begin(files) click to toggle source

Initialize a new report

# File lib/hydra/listener/report_generator.rb, line 6
def testing_begin(files)
  @report = { }
end
testing_end() click to toggle source

output the report

# File lib/hydra/listener/report_generator.rb, line 25
def testing_end
  YAML.dump(@report, @output)
  @output.close
end