Skip to content

Commit f00d440

Browse files
committed
Replace #file with the new #filePath
1 parent 61f0cd5 commit f00d440

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Tests/Helpers/HTTPClientSpy.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ class HTTPClientSpy: HTTPClient {
1717
messages.append((url, completion))
1818
}
1919

20-
func complete(with error: Error, at index: Int = 0, file: StaticString = #file, line: UInt = #line) {
20+
func complete(with error: Error, at index: Int = 0, file: StaticString = #filePath, line: UInt = #line) {
2121
guard messages.count > index else {
2222
return XCTFail("Can't complete request never made", file: file, line: line)
2323
}
2424

2525
messages[index].completion(.failure(error))
2626
}
2727

28-
func complete(withStatusCode code: Int, data: Data, at index: Int = 0, file: StaticString = #file, line: UInt = #line) {
28+
func complete(withStatusCode code: Int, data: Data, at index: Int = 0, file: StaticString = #filePath, line: UInt = #line) {
2929
guard requestedURLs.count > index else {
3030
return XCTFail("Can't complete request never made", file: file, line: line)
3131
}

Tests/Helpers/LoadFeedFromRemoteUseCaseTests+Helpers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import FeedAPIChallenge
77

88
extension LoadFeedFromRemoteUseCaseTests {
99

10-
func expect(_ sut: RemoteFeedLoader, toCompleteWith expectedResult: Result<[FeedImage], RemoteFeedLoader.Error>, when action: () -> Void, file: StaticString = #file, line: UInt = #line) {
10+
func expect(_ sut: RemoteFeedLoader, toCompleteWith expectedResult: Result<[FeedImage], RemoteFeedLoader.Error>, when action: () -> Void, file: StaticString = #filePath, line: UInt = #line) {
1111
let exp = expectation(description: "Wait for load completion")
1212

1313
sut.load { receivedResult in

Tests/Helpers/XCTestCase+MemoryLeakTracking.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import XCTest
66

77
extension XCTestCase {
8-
func trackForMemoryLeaks(_ instance: AnyObject, file: StaticString = #file, line: UInt = #line) {
8+
func trackForMemoryLeaks(_ instance: AnyObject, file: StaticString = #filePath, line: UInt = #line) {
99
addTeardownBlock { [weak instance] in
1010
XCTAssertNil(instance, "Instance should have been deallocated. Potential memory leak.", file: file, line: line)
1111
}

Tests/LoadFeedFromRemoteUseCaseTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class LoadFeedFromRemoteUseCaseTests: XCTestCase {
112112

113113
// MARK: - Helpers
114114

115-
private func makeSUT(url: URL = URL(string: "https://a-url.com")!, file: StaticString = #file, line: UInt = #line) -> (sut: RemoteFeedLoader, client: HTTPClientSpy) {
115+
private func makeSUT(url: URL = URL(string: "https://a-url.com")!, file: StaticString = #filePath, line: UInt = #line) -> (sut: RemoteFeedLoader, client: HTTPClientSpy) {
116116
let client = HTTPClientSpy()
117117
let sut = RemoteFeedLoader(url: url, client: client)
118118
trackForMemoryLeaks(sut, file: file, line: line)

0 commit comments

Comments
 (0)