summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2017-03-01 12:32:56 -0800
committerMuller, Alexander (A.) <amulle19@ford.com>2017-03-01 12:32:56 -0800
commit8f92e6194a538004da32011155cc8c9c6faedcce (patch)
tree89fa8484c7b9ba737508c4d90f4a1206135ea635 /SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m
parent61e6f87b536bc33b944f42be7bad6786c0bab4d1 (diff)
parent1109f73e492a593c1d1c53ed6d19999c5e5f16f3 (diff)
downloadsdl_ios-8f92e6194a538004da32011155cc8c9c6faedcce.tar.gz
Merge remote-tracking branch 'origin/master' into hotfix/issue_538hotfix/issue_538
* origin/master: Update to v4.5.4 Improved state machine throw. Also added in more specific spec to handle this. Added in more descriptive exception throw for debugging. Fixes #539 Xcode 8.3 beta 2 fixes Adding in check for nullable properties of video encoder callback
Diffstat (limited to 'SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m')
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m9
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