@Test public void delegatesDidWork() { context.checking( new Expectations() { { allowing(delegate).getDidWork(); will(onConsecutiveCalls(returnValue(true), returnValue(false))); } }); assertTrue(visitor.getDidWork()); assertFalse(visitor.getDidWork()); }