actually using volotile attributes and outputting sof in test. very readable
This commit is contained in:
@ -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
|
@ -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
|
||||
|
Reference in New Issue
Block a user