class RSpec::Core::ExampleStatusParser

@private
all, who puts those in file names?
example duration) are highly unlikely to contain “n” or “ | ” – after
OK because the values we plan to persist (example id, status, and perhaps
“n” and “ | ”, with no concern for handling escaping. For now, that’s
Note that this parser is a bit naive in that it does a simple split on
Parses a string that has been previously dumped by ExampleStatusDumper.

def self.parse(string)

def self.parse(string)
  new(string).parse
end

def headers

def headers
  @headers ||= split_line(@header_line).grep(/\S/).map(&:to_sym)
end

def initialize(string)

def initialize(string)
  @header_line, _, *@row_lines = string.lines.to_a
end

def parse

def parse
  @row_lines.map { |line| parse_row(line) }
end

def parse_row(line)

def parse_row(line)
  Hash[headers.zip(split_line(line))]
end

def split_line(line)

def split_line(line)
  line.split(/\s+\|\s+?/, -1)
end