Class: MicroTest::BaseFormatter

Inherits:
Object
  • Object
show all
Includes:
Color
Defined in:
lib/micro_test/formatters/base_formatter.rb

Overview

The base class for formatters. Defines the API that formatters can/should implement to control test run output.

Direct Known Subclasses

Formatter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBaseFormatter

Returns a new instance of BaseFormatter.



12
13
14
15
16
# File 'lib/micro_test/formatters/base_formatter.rb', line 12

def initialize
  @duration = 0
  @passed = 0
  @failed = 0
end

Instance Attribute Details

#durationObject

Returns the value of attribute duration.



10
11
12
# File 'lib/micro_test/formatters/base_formatter.rb', line 10

def duration
  @duration
end

#failedObject

Returns the value of attribute failed.



10
11
12
# File 'lib/micro_test/formatters/base_formatter.rb', line 10

def failed
  @failed
end

#passedObject

Returns the value of attribute passed.



10
11
12
# File 'lib/micro_test/formatters/base_formatter.rb', line 10

def passed
  @passed
end

Instance Method Details

#after_class(test_class) ⇒ Object



30
31
# File 'lib/micro_test/formatters/base_formatter.rb', line 30

def after_class(test_class)
end

#after_results(runner) ⇒ Object



33
34
35
36
37
# File 'lib/micro_test/formatters/base_formatter.rb', line 33

def after_results(runner)
  @duration = runner.duration
  @passed = runner.passed
  @failed = runner.failed
end

#after_suite(test_classes) ⇒ Object



39
40
# File 'lib/micro_test/formatters/base_formatter.rb', line 39

def after_suite(test_classes)
end

#after_test(test) ⇒ Object



27
28
# File 'lib/micro_test/formatters/base_formatter.rb', line 27

def after_test(test)
end

#before_class(test_class) ⇒ Object



21
22
# File 'lib/micro_test/formatters/base_formatter.rb', line 21

def before_class(test_class)
end

#before_suite(test_classes) ⇒ Object



18
19
# File 'lib/micro_test/formatters/base_formatter.rb', line 18

def before_suite(test_classes)
end

#before_test(test) ⇒ Object



24
25
# File 'lib/micro_test/formatters/base_formatter.rb', line 24

def before_test(test)
end