From 470964c3ae8af00037417c451f559886eba9efd2 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Mon, 7 Aug 2023 11:53:32 -0400 Subject: [PATCH] Fix CI --- .../Unit/Environment/NSURLSession+GULPromisesTests.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/GoogleUtilities/Tests/Unit/Environment/NSURLSession+GULPromisesTests.m b/GoogleUtilities/Tests/Unit/Environment/NSURLSession+GULPromisesTests.m index 6d6ebd10..eacf6499 100644 --- a/GoogleUtilities/Tests/Unit/Environment/NSURLSession+GULPromisesTests.m +++ b/GoogleUtilities/Tests/Unit/Environment/NSURLSession+GULPromisesTests.m @@ -23,7 +23,6 @@ @interface NSURLSession_GULPromisesTests : XCTestCase @property(nonatomic) NSURLSession *URLSession; -@property(nonatomic) NSString *tmpDirectoryPath; @end @implementation NSURLSession_GULPromisesTests @@ -31,14 +30,12 @@ @implementation NSURLSession_GULPromisesTests - (void)setUp { self.URLSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration]]; - - self.tmpDirectoryPath = NSTemporaryDirectory(); - [[NSFileManager defaultManager] removeItemAtPath:self.tmpDirectoryPath error:nil]; } - (void)testDataTaskPromiseWithRequestSuccess { // Given - NSString *tempPath = [self.tmpDirectoryPath stringByAppendingPathComponent:@"success.txt"]; + NSString *tempPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"success.txt"]; + [[NSFileManager defaultManager] removeItemAtPath:tempPath error:nil]; NSData *expectedData = [@"Hello, world!" dataUsingEncoding:NSUTF8StringEncoding]; BOOL success = [[NSFileManager defaultManager] createFileAtPath:tempPath contents:expectedData @@ -60,7 +57,9 @@ - (void)testDataTaskPromiseWithRequestSuccess { - (void)testDataTaskPromiseWithRequestError { // Given - NSString *tempPath = [self.tmpDirectoryPath stringByAppendingPathComponent:@"does_not_exist.txt"]; + NSString *tempPath = + [NSTemporaryDirectory() stringByAppendingPathComponent:@"does_not_exist.txt"]; + XCTAssertFalse([[NSFileManager defaultManager] fileExistsAtPath:tempPath]); // When NSURL *tempURL = [NSURL fileURLWithPath:tempPath];