'Assert L{UnixApplicationRunner.postApplication} writes
C{reported} to its status pipe if the service raises an
exception whose message is C{raised}.'

def assertErrorWritten(self, raised, reported):

    class FakeService(service.Service, ):
        def startService(self):
            raise RuntimeError(raised)
    errorService = FakeService()
    errorService.setServiceParent(self.runner.application)
    with AlternateReactor(FakeDaemonizingReactor()):
        self.assertRaises(RuntimeError, self.runner.postApplication)
    self.assertEqual(self.mockos.actions, [('chdir', '.'), ('umask', 63), ('fork', True), 'setsid', ('fork', True), ('write', (-2), reported), ('unlink', 'twistd.pid')])
    self.assertEqual(self.mockos.closed, [(-3), (-2)])
