Fix bad test coverage

One typo, one debug test
Also stop producing those object files, use in memory io
This commit is contained in:
2019-09-25 01:14:00 +03:00
parent 42ed70b50b
commit 701890f625
6 changed files with 24 additions and 10 deletions

View File

@ -67,10 +67,20 @@ module Elf
@symbol_table.add_func_symbol name, offset, @text, linkage
end
def save(filename)
to = File.open(filename, 'wb')
@object.write to
to.close
# save to either file or io
# Pass Filename as string
# or any io object
def save(file)
case file
when String
io = File.open(file, 'wb')
when IO , StringIO
io = file
else
raise "must pass io or filename, not #{file}"
end
@object.write io
io.close
end
end