class Testdata::Unit

Attributes

to_s[R]

Public Class Methods

new(s) click to toggle source
Calls superclass method
# File lib/testdata.rb, line 303
def initialize(s)
  
  super()
  @a = []

  buffer, _ = RXFHelper.read(s)

  @doc = Rexle.new(buffer)

  @doc.root.xpath('records/test').map do |test|
    
    path, type, description = test.xpath('summary/*/text()')        
    records = test.element('records')        
    
    inputs = records.xpath('input/summary/*').map\
                                        {|x| [x.name, x.texts.join.strip]}

    outputs = records.xpath('output/summary/*').map\
                                        {|x| [x.name, x.texts.join.strip]}
    
    @a << {type: type, in: inputs, out: outputs}
    
  end

end