also test custom whenUnhandled fall-through
This commit is contained in:
parent
d5fc6f8ebd
commit
c2402e39cd
1 changed files with 7 additions and 3 deletions
|
|
@ -16,7 +16,7 @@ class FSMTimingSpec
|
|||
|
||||
val fsm = Actor.actorOf(new StateMachine(testActor)).start
|
||||
fsm ! SubscribeTransitionCallBack(testActor)
|
||||
expectMsg(50 millis, Initial)
|
||||
expectMsg(100 millis, Initial)
|
||||
|
||||
ignoreMsg {
|
||||
case Transition(Initial, _) => true
|
||||
|
|
@ -66,6 +66,10 @@ class FSMTimingSpec
|
|||
expectMsg(Unhandled(Tick))
|
||||
expectNoMsg
|
||||
}
|
||||
within(100 millis) {
|
||||
fsm ! Unhandled("test")
|
||||
expectNoMsg
|
||||
}
|
||||
within(100 millis) {
|
||||
fsm ! Cancel
|
||||
expectMsg(Transition(TestUnhandled, Initial))
|
||||
|
|
@ -123,8 +127,8 @@ object FSMTimingSpec {
|
|||
when(TestUnhandled) {
|
||||
case Ev(SetHandler) =>
|
||||
whenUnhandled {
|
||||
case Ev(msg : AnyRef) =>
|
||||
tester ! Unhandled(msg)
|
||||
case Ev(Tick) =>
|
||||
tester ! Unhandled(Tick)
|
||||
stay
|
||||
}
|
||||
stay
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue