tests: use string writer instead of mock writer