rewrote write to use known attributes or instance variables, simple values inline

This commit is contained in:
Torsten Ruger
2014-08-14 19:49:20 +03:00
parent 7eeb269d50
commit 6b19b915a1
3 changed files with 40 additions and 16 deletions

View File

@ -1,6 +1,10 @@
require_relative "helper"
class SimpleObjectWithAttributes
class ObjectWithAttributes
def initialize
@name = "some object"
@number = 1234
end
end
class BasicSof < MiniTest::Test
@ -13,5 +17,8 @@ class BasicSof < MiniTest::Test
out = Sof::Writer.write(124)
assert_equal "124" , out
end
def test_object
out = Sof::Writer.write(ObjectWithAttributes.new)
assert_equal " ObjectWithAttributes(name: 'some object' ,number: 1234)\n" , out
end
end