Class: Testdata::Unit
- Inherits:
-
Object
- Object
- Testdata::Unit
- Defined in:
- lib/testdata.rb
Instance Attribute Summary collapse
-
#to_s ⇒ Object
readonly
end of initialize().
Instance Method Summary collapse
-
#initialize(s) ⇒ Unit
constructor
A new instance of Unit.
Constructor Details
#initialize(s) ⇒ Unit
Returns a new instance of Unit.
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
# File 'lib/testdata.rb', line 329 def initialize(s) super() @a = [] buffer, _ = RXFReader.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_s ⇒ Object (readonly)
end of initialize()
355 356 357 |
# File 'lib/testdata.rb', line 355 def to_s @to_s end |