fixed the yaml output order for much better readability of failed tests

This commit is contained in:
Torsten Ruger
2014-07-19 21:56:17 +03:00
parent eb44011177
commit a6e78ec837
2 changed files with 17 additions and 3 deletions

View File

@ -1,6 +1,5 @@
require_relative '../helper'
require 'parslet/convenience'
require "yaml"
module VirtualHelper
# need a code generator, for arm
@ -20,3 +19,18 @@ module VirtualHelper
end
end
require "yaml" # not my first choice, but easy with graphs
# for readability of the yaml output :next of instructions last
Psych::Visitors::YAMLTree.class_eval do
private
def dump_ivars target
ivars = find_ivars target
ivars << :@next if ivars.delete(:@next)
ivars.each do |iv|
@emitter.scalar("#{iv.to_s.sub(/^@/, '')}", nil, nil, true, false, Psych::Nodes::Scalar::ANY)
accept target.instance_variable_get(iv)
end
end
end