Class: Minitest::TestProf::MemoryProfReporter

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

Overview

:nodoc:

Constant Summary

Constants included from TestProf::Logging

TestProf::Logging::COLORS

Instance Attribute Summary collapse

Attributes inherited from BaseReporter

#io

Instance Method Summary collapse

Methods inherited from BaseReporter

#after_test, #before_test

Methods included from TestProf::Logging

#log

Constructor Details

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

Returns a new instance of MemoryProfReporter.



10
11
12
13
14
15
16
17
18
19
# File 'lib/test_prof/memory_prof/minitest.rb', line 10

def initialize(io = $stdout, options = {})
  super

  configure_profiler(options)

  @tracker = ::TestProf::MemoryProf.tracker
  @printer = ::TestProf::MemoryProf.printer(tracker)

  @current_example = nil
end

Instance Attribute Details

#current_exampleObject (readonly)

Returns the value of attribute current_example.



8
9
10
# File 'lib/test_prof/memory_prof/minitest.rb', line 8

def current_example
  @current_example
end

#printerObject (readonly)

Returns the value of attribute printer.



8
9
10
# File 'lib/test_prof/memory_prof/minitest.rb', line 8

def printer
  @printer
end

#trackerObject (readonly)

Returns the value of attribute tracker.



8
9
10
# File 'lib/test_prof/memory_prof/minitest.rb', line 8

def tracker
  @tracker
end

Instance Method Details

#prerecord(group, example) ⇒ Object



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

def prerecord(group, example)
  set_current_example(group, example)
  tracker.example_started(current_example)
end

#record(example) ⇒ Object



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

def record(example)
  tracker.example_finished(current_example)
end

#reportObject



34
35
36
37
# File 'lib/test_prof/memory_prof/minitest.rb', line 34

def report
  tracker.finish
  printer.print
end

#startObject



30
31
32
# File 'lib/test_prof/memory_prof/minitest.rb', line 30

def start
  tracker.start
end