Serialise should raise if IO#read returns nil
Noticed in implementing static types: the #serialise
method returns String | nil
since (I think) IO#read
may return nil
, that could only happen on error (it is reading from one end of a pipe) so we could reasonably raise there. Mocking could test, and if it works out then simplify the signatures.
Edited by J.J. Green