Created
February 28, 2013 10:55
-
-
Save toco/5055909 to your computer and use it in GitHub Desktop.
Partial mocking with OCMockito, OCHamcrest sut calls showAlert (verified in debugger) but the test fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testShowsAlertViewWhenOpenInSafariFails | |
{ | |
sut = spy(sut); | |
// given | |
[sut view]; | |
UIApplication *application = mock([UIApplication class]); | |
sut.application = application; | |
// when | |
[given([application openURL:sut.url]) willReturnBool:NO]; | |
[sut openInSafari:nil]; | |
// then | |
[verify(sut) showAlert]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment