actually using volotile attributes and outputting sof in test. very readable

This commit is contained in:
Torsten Ruger
2014-08-18 17:16:18 +03:00
parent a594b716bc
commit 81f8f0f3a2
4 changed files with 7 additions and 5 deletions

View File

@ -8,7 +8,7 @@ class ObjectWithAttributes
end
attr_accessor :extra
end
OBJECT_STRING = "ObjectWithAttributes(name: 'some name', number: 1234)"
OBJECT_STRING = "ObjectWithAttributes(:name => 'some name', :number => 1234)"
class BasicSof < MiniTest::Test
def check should
@ -84,6 +84,6 @@ class BasicSof < MiniTest::Test
object = ObjectWithAttributes.new
object.extra = object
@out = Sof::Writer.write(object)
check "&1 ObjectWithAttributes(name: 'some name', number: 1234, extra: *1)"
check "&1 ObjectWithAttributes(:name => 'some name', :number => 1234, :extra => *1)"
end
end

View File

@ -11,7 +11,9 @@ module VirtualHelper
machine = Virtual::Machine.boot
expressions = machine.compile_main @string_input
should = YAML.load(@output.gsub("RETURN_MARKER" , "\n"))
assert_equal should , expressions , expressions.to_yaml.gsub("\n" , "RETURN_MARKER") + "\n" + Sof::Members.write(expressions)
assert_equal should , expressions , expressions.to_yaml.gsub("\n" , "RETURN_MARKER") + "\n" + Sof::Writer.write(expressions)
puts ""
puts Sof::Writer.write(expressions)
end
end