Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Trivial
-
Resolution: Fixed
-
Affects Version/s: 2.5.0
-
Fix Version/s: 2.6.0
-
Component/s: JMock 2.x.x Library
-
Labels:None
-
Number of attachments :
Description
Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
assertTrue(stateMachine.is("desired-state").isActive());
assertTrue(stateMachine.isNot("undesirable-state").isActive())
I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
assertTrue(stateMachine.isCurrently("state"));
assertTrue(stateMachine.isNotCurrently("state"));
How about:
assertThat(stateMachine, isCurrently("state"))
for example?