diff --git a/lib/virtual/object.rb b/lib/virtual/object.rb index 6ee7dd35..7dd23dcd 100644 --- a/lib/virtual/object.rb +++ b/lib/virtual/object.rb @@ -23,7 +23,7 @@ module Virtual end def inspect - self.class.name + ".new(" + attributes.collect{|a| send(a).inspect }.join(",")+ ")" + to_yaml end def self.space diff --git a/test/virtual/virtual_helper.rb b/test/virtual/virtual_helper.rb index ff7f124e..73a66bfe 100644 --- a/test/virtual/virtual_helper.rb +++ b/test/virtual/virtual_helper.rb @@ -1,5 +1,6 @@ require_relative '../helper' require 'parslet/convenience' +require "yaml" module VirtualHelper # need a code generator, for arm @@ -14,7 +15,8 @@ module VirtualHelper machine = Virtual::Machine.new main = Virtual::MethodDefinition.main expressions = parts.compile(machine.frame , main ) - assert_equal @output , expressions + should = YAML.load(@output.gsub("_MY_MY_MARKER" , "\n")) + assert_equal should , expressions , expressions.to_yaml.gsub("\n" , "_MY_MY_MARKER") + "\n" + expressions.to_yaml end end