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
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/testdata.rb', line 283 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_s ⇒ Object (readonly)
end of initialize()
309 310 311 |
# File 'lib/testdata.rb', line 309 def to_s @to_s end |