@Test public void importMockInReusableVerificationBlock() { new ReusableExpectations() {}; dependency.notifyBeforeSave(); dependency.save(); new ReusableVerifications() {}; }
@Test public void importMockFromReusableExpectationBlock() { new ReusableExpectations() {}; dependency.notifyBeforeSave(); dependency.save(); new VerificationsInOrder() { Dependency dep; { dep.notifyBeforeSave(); unverifiedInvocations(); } }; }
@Test public void importLocalMockFromPreviousNonStrictExpectationsBlock() { new NonStrictExpectations() { Dependency mock; { mock.notifyBeforeSave(); result = true; } }; dependency.editABunchMoreStuff(); assertTrue(dependency.notifyBeforeSave()); new Verifications() { Dependency mock; { mock.editABunchMoreStuff(); } }; }
{ mock.notifyBeforeSave(); result = true; }