Class: QUnited::Formatter::Base
- Inherits:
-
Object
- Object
- QUnited::Formatter::Base
- Defined in:
- lib/qunited/formatter/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#driver_name ⇒ Object
readonly
Returns the value of attribute driver_name.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#test_results ⇒ Object
readonly
Returns the value of attribute test_results.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
-
#message ⇒ Object
Send arbitrary messages to the output stream.
-
#start ⇒ Object
Called before we start running tests.
-
#stop ⇒ Object
Called after all tests have run, before we summarize results.
-
#summarize ⇒ Object
Called after we have stopped running tests.
- #test_failed(result) ⇒ Object
- #test_passed(result) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 |
# File 'lib/qunited/formatter/base.rb', line 6 def initialize(={}) @driver_name = [:driver_name] @output = [:output] || $stdout @test_results = [] end |
Instance Attribute Details
#driver_name ⇒ Object (readonly)
Returns the value of attribute driver_name.
4 5 6 |
# File 'lib/qunited/formatter/base.rb', line 4 def driver_name @driver_name end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/qunited/formatter/base.rb', line 4 def output @output end |
#test_results ⇒ Object (readonly)
Returns the value of attribute test_results.
4 5 6 |
# File 'lib/qunited/formatter/base.rb', line 4 def test_results @test_results end |
Instance Method Details
#close ⇒ Object
37 38 39 |
# File 'lib/qunited/formatter/base.rb', line 37 def close output.close if IO === output && output != $stdout end |
#message ⇒ Object
Send arbitrary messages to the output stream
25 26 27 |
# File 'lib/qunited/formatter/base.rb', line 25 def output.puts end |
#start ⇒ Object
Called before we start running tests
13 14 |
# File 'lib/qunited/formatter/base.rb', line 13 def start end |
#stop ⇒ Object
Called after all tests have run, before we summarize results
30 31 |
# File 'lib/qunited/formatter/base.rb', line 30 def stop end |
#summarize ⇒ Object
Called after we have stopped running tests
34 35 |
# File 'lib/qunited/formatter/base.rb', line 34 def summarize end |
#test_failed(result) ⇒ Object
20 21 22 |
# File 'lib/qunited/formatter/base.rb', line 20 def test_failed(result) @test_results << result end |
#test_passed(result) ⇒ Object
16 17 18 |
# File 'lib/qunited/formatter/base.rb', line 16 def test_passed(result) @test_results << result end |