spy/objects: fix newline bug
add tests