fixing unit test to work with buffered writer