Could you add an expectation on `@io.encoding` here so that it's explicit that the encoding change is a side-effect of appending the string.

Also, yes, this spec should be in #<< or #write.