Skip to content

Commit

Permalink
Fix testDiskCacheURL test
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmoon committed Jun 10, 2019
1 parent aee1551 commit 004736e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Tests/PINCacheTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,8 @@ - (void)testCoreProperties

- (void)testDiskCacheURL
{
// Wait for URL to be created
dispatch_group_t group = dispatch_group_create();
dispatch_group_enter(group);
[self.cache objectForKeyAsync:@"" completion:^(PINCache * _Nonnull cache, NSString * _Nonnull key, id _Nullable object) {
dispatch_group_leave(group);
}];

dispatch_group_wait(group, DISPATCH_TIME_FOREVER);
// Wait for URL to be created. We use enumerateObjectsWithBlock because it waits for a known disk state.
[self.cache.diskCache enumerateObjectsWithBlock:^(NSString * _Nonnull key, NSURL * _Nullable fileURL, BOOL * _Nonnull stop) {}];
BOOL isDir = NO;
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:[self.cache.diskCache.cacheURL path] isDirectory:&isDir];

Expand Down

0 comments on commit 004736e

Please sign in to comment.