Class: Testdata::Unit

Inherits:
Object
  • Object
show all
Defined in:
lib/testdata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(s) ⇒ Unit

Returns a new instance of Unit.



303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# 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

Instance Attribute Details

#to_sObject (readonly)

end of initialize()



329
330
331
# File 'lib/testdata.rb', line 329

def to_s
  @to_s
end