Method: Beaker::Result#finalize!

Defined in:
lib/beaker/result.rb

#finalize!Object

Ruby assumes chunked data (like something it receives from Net::SSH) to be binary (ASCII-8BIT). We need to gather all chunked data and then re-encode it as the default encoding it assumes for external text (ie our test files and the strings they’re trying to match Net::SSH’s output from) This is also the lowest overhead place to normalize line endings, IIRC



20
21
22
23
24
25
26
27
# File 'lib/beaker/result.rb', line 20

def finalize!
  @raw_stdout = @stdout
  @stdout     = normalize_line_endings( convert( @stdout ) )
  @raw_stderr = @stderr
  @stderr     = normalize_line_endings( convert( @stderr ) )
  @raw_output = @output
  @output     = normalize_line_endings( convert( @output ) )
end