public function testWriteDetectsWhenOtherSideIsClosed()
{
list($a, $b) = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP);
$loop = $this->createWriteableLoopMock();
$buffer = new Buffer($a, $loop);
$buffer->softLimit = 4;
$buffer->on('error', $this->expectCallableOnce());
fclose($b);
$buffer->write("foo");
}