'If the predicate returns something falsey followed by something truthy,
then ``loop_until`` returns it immediately.'

@capture_logging(None)
def test_multiple_iterations(self, logger):

    result = object()
    results = [None, False, result]
    expected_results = results[:(-1)]
    def predicate():
        return results.pop(0)
    clock = Clock()
    d = loop_until(clock, predicate)
    clock.advance(0.1)
    self.assertNoResult(d)
    clock.advance(0.1)
    self.assertEqual(self.successResultOf(d), result)
    action = LoggedAction.of_type(logger.messages, LOOP_UNTIL_ACTION)[0]
    assertContainsFields(self, action.start_message, {'predicate': predicate})
    assertContainsFields(self, action.end_message, {'result': result})
    self.assertTrue(action.succeeded)
    messages = LoggedMessage.of_type(logger.messages, LOOP_UNTIL_ITERATION_MESSAGE)
    self.assertEqual(action.children, messages)
    self.assertEqual([messages[0].message['result'], messages[1].message['result']], expected_results)
