Add test for writeToStream without stream argument