Class: Test::Unit::Coverage::Collector
- Inherits:
-
Object
- Object
- Test::Unit::Coverage::Collector
- Defined in:
- lib/test/unit/coverage.rb
Instance Attribute Summary collapse
-
#printer ⇒ Object
Returns the value of attribute printer.
Class Method Summary collapse
Instance Method Summary collapse
- #attach_to_mediator(mediator) ⇒ Object
- #finished(result) ⇒ Object
-
#initialize ⇒ Collector
constructor
A new instance of Collector.
- #started(result) ⇒ Object
Constructor Details
#initialize ⇒ Collector
Returns a new instance of Collector.
60 61 62 |
# File 'lib/test/unit/coverage.rb', line 60 def initialize @printer = Coverage.printer || DefaultPrinter.new end |
Instance Attribute Details
#printer ⇒ Object
Returns the value of attribute printer.
58 59 60 |
# File 'lib/test/unit/coverage.rb', line 58 def printer @printer end |
Class Method Details
.available? ⇒ Boolean
53 54 55 |
# File 'lib/test/unit/coverage.rb', line 53 def available? Object.const_defined?(:Coverage) end |
Instance Method Details
#attach_to_mediator(mediator) ⇒ Object
64 65 66 67 68 69 |
# File 'lib/test/unit/coverage.rb', line 64 def attach_to_mediator(mediator) mediator.add_listener(UI::TestRunnerMediator::STARTED, &method(:started)) mediator.add_listener(UI::TestRunnerMediator::FINISHED, &method(:finished)) end |
#finished(result) ⇒ Object
75 76 77 |
# File 'lib/test/unit/coverage.rb', line 75 def finished(result) @printer.print(::Coverage.result) end |
#started(result) ⇒ Object
71 72 73 |
# File 'lib/test/unit/coverage.rb', line 71 def started(result) @result = result end |