Class CI::Reporter::OutputCapture
In: lib/ci/reporter/test_suite.rb
Parent: DelegateClass(IO)

Emulates/delegates IO to $stdout or $stderr in order to capture output to report in the XML file.

Methods

finish   new  

Public Class methods

Start capturing IO, using the given block to assign self to the proper IO global.

[Source]

    # File lib/ci/reporter/test_suite.rb, line 13
13:       def initialize(io, &assign)
14:         super
15:         @delegate_io = io
16:         @captured_io = StringIO.new
17:         @assign_block = assign
18:         @assign_block.call self
19:       end

Public Instance methods

Finalize the capture and reset to the original IO object.

[Source]

    # File lib/ci/reporter/test_suite.rb, line 22
22:       def finish
23:         @assign_block.call @delegate_io
24:         @captured_io.string
25:       end

[Validate]