Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.5.1
-
Fix Version/s: None
-
Component/s: JMock 2.x.x Library
-
Labels:None
Description
For example,
@Mock(Never.class)
private SomeCollaborator collaborator;
where:
public class Never implements MockExpectations {
@Override
public void apply(Mockery context, final Object mock) {
context.checking( new Expectations() {{ never(mock); }} );
}
}
The idea here is that Never, Ignoring, Allowing etc would be predefined implementations of MockExpectations, but that also developers could write their own implemnetations. One could also, perhaps, allow multiple expectations to be combined, eg:
@Mock(AllowingSomething.class, ButAfterThatNothing.class)
private SomeCollaborator collaborator;