test for array with array
This commit is contained in:
parent
198e70b6bd
commit
716bc93e4a
@ -1,7 +1,7 @@
|
||||
Array.class_eval do
|
||||
def to_sof(io , members , level)
|
||||
each do |object|
|
||||
io.write(" " * level)
|
||||
each_with_index do |object , i|
|
||||
io.write(" " * level) unless i == 0
|
||||
io.write("-")
|
||||
members.output(io , object)
|
||||
io.write("\n")
|
||||
|
@ -28,5 +28,9 @@ class BasicSof < MiniTest::Test
|
||||
out = Sof::Writer.write([true, 1234 , ObjectWithAttributes.new])
|
||||
assert_equal "-true\n-1234\n-ObjectWithAttributes(name: 'some object' ,number: 1234)\n\n" , out
|
||||
end
|
||||
def test_array_with_array
|
||||
out = Sof::Writer.write([true, 1234 , [true , 12 ]])
|
||||
assert_equal "-true\n-1234\n--true\n -12\n\n" , out
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user