Class: MicroTest::BaseFormatter
- Inherits:
-
Object
- Object
- MicroTest::BaseFormatter
show all
- 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.
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BaseFormatter.
29
30
31
32
33
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 29
def initialize
@duration = 0
@passed = 0
@failed = 0
end
|
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
13
14
15
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 13
def duration
@duration
end
|
#failed ⇒ Object
Returns the value of attribute failed.
13
14
15
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 13
def failed
@failed
end
|
#passed ⇒ Object
Returns the value of attribute passed.
13
14
15
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 13
def passed
@passed
end
|
Class Method Details
.inherited(subclass) ⇒ Object
16
17
18
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 16
def inherited(subclass)
MicroTest.formatters << subclass
end
|
.set_short_name(value) ⇒ Object
24
25
26
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 24
def set_short_name(value)
@short_name = value
end
|
.short_name ⇒ Object
20
21
22
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 20
def short_name
@short_name || name
end
|
Instance Method Details
#after_class(test_class) ⇒ Object
47
48
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 47
def after_class(test_class)
end
|
#after_results(runner) ⇒ Object
50
51
52
53
54
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 50
def after_results(runner)
@duration = runner.duration
@passed = runner.passed
@failed = runner.failed
end
|
#after_suite(test_classes) ⇒ Object
56
57
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 56
def after_suite(test_classes)
end
|
#after_test(test) ⇒ Object
44
45
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 44
def after_test(test)
end
|
#before_class(test_class) ⇒ Object
38
39
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 38
def before_class(test_class)
end
|
#before_suite(test_classes) ⇒ Object
35
36
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 35
def before_suite(test_classes)
end
|
#before_test(test) ⇒ Object
41
42
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 41
def before_test(test)
end
|
#render(template_name, template_context = nil) ⇒ Object
59
60
61
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 59
def render(template_name, template_context=nil)
puts text_to_render(template_name, template_context)
end
|
#render_inline(template_name, template_context = nil) ⇒ Object
63
64
65
|
# File 'lib/micro_test/formatters/base_formatter.rb', line 63
def render_inline(template_name, template_context=nil)
print text_to_render(template_name, template_context)
end
|