Rename to `write` in `serialize` test function.

Rename `object` to `write` in `serialize` test function.

See #216