From 2d6a43cf0ec0daa1fd522d88165fb1ff58e09855 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Fri, 15 Aug 2014 15:13:36 +0300 Subject: [PATCH] array with object --- test/sof.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/sof.rb b/test/sof.rb index d98a11e8..ffe8c052 100644 --- a/test/sof.rb +++ b/test/sof.rb @@ -6,6 +6,7 @@ class ObjectWithAttributes @number = 1234 end end +OBJECT_STRING = "ObjectWithAttributes(name: 'some object' ,number: 1234)" class BasicSof < MiniTest::Test def test_true @@ -18,28 +19,27 @@ class BasicSof < MiniTest::Test end def test_object out = Sof::Writer.write(ObjectWithAttributes.new) - assert_equal "ObjectWithAttributes(name: 'some object' ,number: 1234)\n" , out + assert_equal "#{OBJECT_STRING}\n" , out end def test_simple_array out = Sof::Writer.write([true, 1234]) - assert_equal "-true\n-1234\n" , out + assert_equal "-true\n-1234\n" , out end def test_array_object out = Sof::Writer.write([true, 1234 , ObjectWithAttributes.new]) - assert_equal "-true\n-1234\n-ObjectWithAttributes(name: 'some object' ,number: 1234)\n\n" , out + assert_equal "-true\n-1234\n-#{OBJECT_STRING}\n\n" , out end def test_array_array out = Sof::Writer.write([true, 1 , [true , 12 ]]) - assert_equal "-true\n-1\n--true\n -12\n\n" , out + assert_equal "-true\n-1\n--true\n -12\n\n" , out end def test_array_array_array out = Sof::Writer.write([true, 1 , [true , 12 , [true , 123 ]]]) - assert_equal "-true\n-1\n--true\n -12\n --true\n -123\n\n\n" , out + assert_equal "-true\n-1\n--true\n -12\n --true\n -123\n\n\n" , out end - def ttest_array_array_object + def test_array_array_object out = Sof::Writer.write([true, 1 , [true , 12 , ObjectWithAttributes.new]]) -# puts out - assert_equal "-true\n-1234\n--true\n -12\n\n" , out + assert_equal "-true\n-1\n--true\n -12\n -#{OBJECT_STRING}\n\n\n" , out end end \ No newline at end of file