Class: Minitest::TestProf::EventProfReporter

Inherits:
BaseReporter
  • Object
show all
Defined in:
lib/test_prof/event_prof/minitest.rb

Overview

:nodoc:

Constant Summary

Constants included from TestProf::Logging

TestProf::Logging::COLORS

Instance Attribute Summary

Attributes inherited from BaseReporter

#io

Instance Method Summary collapse

Methods inherited from BaseReporter

#after_test, #start

Methods included from TestProf::Logging

#build_log_msg, #colorize, #log

Constructor Details

#initialize(io = $stdout, options = {}) ⇒ EventProfReporter

Returns a new instance of EventProfReporter.



9
10
11
12
13
14
15
# File 'lib/test_prof/event_prof/minitest.rb', line 9

def initialize(io = $stdout, options = {})
  super
  @profiler = configure_profiler(options)
  @formatter = EventProfFormatter.new(@profiler)
  @current_group = nil
  @current_example = nil
end

Instance Method Details

#before_test(test) ⇒ Object



22
23
24
# File 'lib/test_prof/event_prof/minitest.rb', line 22

def before_test(test)
  prerecord(test.class, test.name)
end

#prerecord(group, example) ⇒ Object



17
18
19
20
# File 'lib/test_prof/event_prof/minitest.rb', line 17

def prerecord(group, example)
  change_current_group(group, example) unless @current_group
  track_current_example(group, example)
end

#recordObject



26
27
28
# File 'lib/test_prof/event_prof/minitest.rb', line 26

def record(*)
  @profiler.example_finished(@current_example)
end

#reportObject



30
31
32
33
34
# File 'lib/test_prof/event_prof/minitest.rb', line 30

def report
  @profiler.group_finished(@current_group)
  result = @formatter.prepare_results
  log :info, result
end