Class: QUnited::Formatter::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/qunited/formatter/base.rb

Direct Known Subclasses

Dots

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options={})
  @driver_name = options[:driver_name]
  @output = options[:output] || $stdout
  @test_results = []
end

Instance Attribute Details

#driver_nameObject (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

#outputObject (readonly)

Returns the value of attribute output.



4
5
6
# File 'lib/qunited/formatter/base.rb', line 4

def output
  @output
end

#test_resultsObject (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

#closeObject



37
38
39
# File 'lib/qunited/formatter/base.rb', line 37

def close
  output.close if IO === output && output != $stdout
end

#messageObject

Send arbitrary messages to the output stream



25
26
27
# File 'lib/qunited/formatter/base.rb', line 25

def message
  output.puts message
end

#startObject

Called before we start running tests



13
14
# File 'lib/qunited/formatter/base.rb', line 13

def start
end

#stopObject

Called after all tests have run, before we summarize results



30
31
# File 'lib/qunited/formatter/base.rb', line 30

def stop
end

#summarizeObject

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