From 378c4e91f560ae0a0818457dd8215411eec8c2ac Mon Sep 17 00:00:00 2001 From: Stephan Diederich Date: Wed, 11 Sep 2013 14:53:02 +0200 Subject: [PATCH] fix tests for validation / authviewcontroller bringing up authViewController again is handled by the default completion block. So we need to pass it along --- Classes/BITAuthenticator_Private.h | 2 ++ Support/HockeySDKTests/BITAuthenticatorTests.m | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/BITAuthenticator_Private.h b/Classes/BITAuthenticator_Private.h index 667e6192e0..4eb13c154c 100644 --- a/Classes/BITAuthenticator_Private.h +++ b/Classes/BITAuthenticator_Private.h @@ -131,4 +131,6 @@ - (void) validationSucceededWithCompletion:(tValidationCompletion) completion; - (void) validationFailedWithError:(NSError *) validationError completion:(tValidationCompletion) completion; +#pragma mark - Helpers for testing +- (tValidationCompletion) defaultValidationCompletionBlock; @end diff --git a/Support/HockeySDKTests/BITAuthenticatorTests.m b/Support/HockeySDKTests/BITAuthenticatorTests.m index 07f75a971b..1a09aafcd2 100644 --- a/Support/HockeySDKTests/BITAuthenticatorTests.m +++ b/Support/HockeySDKTests/BITAuthenticatorTests.m @@ -375,7 +375,7 @@ static void *kInstallationIdentification = &kInstallationIdentification; _sut.validationType = BITAuthenticatorValidationTypeOnAppActive; [_sut validationFailedWithError:[NSError errorWithDomain:kBITAuthenticatorErrorDomain code:0 userInfo:nil] - completion:nil]; + completion:_sut.defaultValidationCompletionBlock]; [verifyCount(delegateMock, times(1)) authenticator:_sut willShowAuthenticationController:(id)anything()]; } @@ -385,7 +385,7 @@ static void *kInstallationIdentification = &kInstallationIdentification; _sut.validationType = BITAuthenticatorValidationTypeOptional; [_sut validationFailedWithError:nil - completion:nil]; + completion:_sut.defaultValidationCompletionBlock]; [verifyCount(delegateMock, never()) authenticator:_sut willShowAuthenticationController:(id)anything()]; }