Add tests for NodeWriter#write