diff options
Diffstat (limited to 'SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m')
-rw-r--r-- | SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m index d657586e5..af851d09b 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m @@ -121,11 +121,14 @@ describe(@"A state machine", ^{ }); it(@"should throw an exception trying to transition incorrectly and nothing should be called", ^{ + NSString *stateMachineClassString = NSStringFromClass(testStateMachine.class); + NSString *targetClassString = NSStringFromClass(testTarget.class); + // Side effects, but I can't think of any other way around it. expectAction(^{ [testStateMachine transitionToState:thirdState]; - }).to(raiseException().named(NSInternalInconsistencyException)); - + }).to(raiseException().named(NSInternalInconsistencyException).reason([NSString stringWithFormat:@"Invalid state machine %@ transition of target %@ occurred from %@ to %@", stateMachineClassString, targetClassString, initialState, thirdState]).userInfo(@{@"fromState": initialState, @"toState": thirdState, @"targetClass": targetClassString})); + expect(@([testStateMachine isCurrentState:initialState])).to(equal(@YES)); expect(@([testStateMachine isCurrentState:thirdState])).to(equal(@NO)); expect(@(willLeaveNotificationCalled)).to(equal(@NO)); @@ -141,4 +144,6 @@ describe(@"A state machine", ^{ }); }); +// Invalid state machine transition of TestStateMachineTarget occurred from Initial to Third + QuickSpecEnd |