@@ -63,48 +63,6 @@ - (void)testMemoryWarningSimulator
63
63
}
64
64
65
65
- (void )testMockingOpenURL
66
- {
67
- __block BOOL openURLReturnValue;
68
- __block BOOL canOpenURLReturnValue;
69
- [system waitForApplicationToOpenURL: @" test123://" whileExecutingBlock: ^{
70
- NSURL *uninstalledAppURL = [NSURL URLWithString: @" test123://" ];
71
- canOpenURLReturnValue = [[UIApplication sharedApplication ] canOpenURL: uninstalledAppURL];
72
- openURLReturnValue = [[UIApplication sharedApplication ] openURL: uninstalledAppURL];
73
- } returning: NO ];
74
- KIFAssertEqual (NO , openURLReturnValue, @" openURL: should have returned NO" );
75
- KIFAssertEqual (NO , canOpenURLReturnValue, @" canOpenURL: should have returned NO" );
76
-
77
- [system waitForApplicationToOpenURL: @" test123://" whileExecutingBlock: ^{
78
- NSURL *installedAppURL = [NSURL URLWithString: @" test123://" ];
79
- canOpenURLReturnValue = [[UIApplication sharedApplication ] canOpenURL: installedAppURL];
80
- openURLReturnValue = [[UIApplication sharedApplication ] openURL: installedAppURL];
81
- } returning: YES ];
82
- KIFAssertEqual (YES , openURLReturnValue, @" openURL: should have returned YES" );
83
- KIFAssertEqual (YES , canOpenURLReturnValue, @" canOpenURL: should have returned YES" );
84
-
85
- [system waitForApplicationToOpenURLWithScheme: @" test123" whileExecutingBlock: ^{
86
- NSURL *installedAppURL = [NSURL URLWithString: @" test123://some/path?query" ];
87
- canOpenURLReturnValue = [[UIApplication sharedApplication ] canOpenURL: installedAppURL];
88
- openURLReturnValue = [[UIApplication sharedApplication ] openURL: installedAppURL];
89
- } returning: YES ];
90
- KIFAssertEqual (YES , openURLReturnValue, @" openURL: should have returned YES" );
91
- KIFAssertEqual (YES , canOpenURLReturnValue, @" canOpenURL: should have returned YES" );
92
-
93
- [system waitForApplicationToOpenAnyURLWhileExecutingBlock: ^{
94
- NSURL *someURL = [NSURL URLWithString: @" 423543523454://" ];
95
- canOpenURLReturnValue = [[UIApplication sharedApplication ] canOpenURL: someURL];
96
- openURLReturnValue = [[UIApplication sharedApplication ] openURL: someURL];
97
- } returning: YES ];
98
- KIFAssertEqual (YES , openURLReturnValue, @" openURL: should have returned YES" );
99
- KIFAssertEqual (YES , canOpenURLReturnValue, @" canOpenURL: should have returned YES" );
100
-
101
- NSURL *fakeURL = [NSURL URLWithString: @" this-is-a-fake-url://" ];
102
- KIFAssertFalse ([[UIApplication sharedApplication ] canOpenURL: fakeURL], @" Should no longer be mocking, reject bad URL." );
103
- KIFAssertFalse ([[UIApplication sharedApplication ] openURL: fakeURL], @" Should no longer be mocking, reject bad URL." );
104
- }
105
-
106
- #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000
107
- - (void )testMockingOpenURLiOS10xAndUp
108
66
{
109
67
__block BOOL canOpenURLReturnValue;
110
68
[system waitForApplicationToOpenURL: @" test123://" whileExecutingBlock: ^{
@@ -138,6 +96,5 @@ - (void)testMockingOpenURLiOS10xAndUp
138
96
NSURL *fakeURL = [NSURL URLWithString: @" this-is-a-fake-url://" ];
139
97
KIFAssertFalse ([[UIApplication sharedApplication ] canOpenURL: fakeURL], @" Should no longer be mocking, reject bad URL." );
140
98
}
141
- #endif
142
99
143
100
@end
0 commit comments