Skip to content

Commit 0e11110

Browse files
committed
Remove redundant tests
1 parent 62b44ca commit 0e11110

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

Sources/ImagePreheater.swift

-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public final class ImagePreheater {
8181
let operation = Operation(starter: { [weak self] finish in
8282
let task = self?.pipeline.loadImage(with: request) { [weak self] _, _ in
8383
self?._remove(task)
84-
self?.didFinishPreheatingRequest?(task.request)
8584
finish()
8685
}
8786
token.register {
@@ -154,9 +153,6 @@ public final class ImagePreheater {
154153
return request
155154
}
156155

157-
/// For testing purposes.
158-
var didFinishPreheatingRequest: ((ImageRequest) -> Void)?
159-
160156
private final class Task {
161157
let key: PreheatKey
162158
let request: ImageRequest

Tests/ImagePreheaterTests.swift

-38
Original file line numberDiff line numberDiff line change
@@ -112,41 +112,3 @@ class ImagePreheaterTests: XCTestCase {
112112
wait()
113113
}
114114
}
115-
116-
class ImagePreheterDiskCacheTests: XCTestCase {
117-
var imageCache: MockImageCache!
118-
var dataLoader: MockDataLoader!
119-
var pipeline: ImagePipeline!
120-
var preheater: ImagePreheater!
121-
122-
override func setUp() {
123-
super.setUp()
124-
125-
pipeline = MockImagePipeline()
126-
dataLoader = MockDataLoader()
127-
imageCache = MockImageCache()
128-
pipeline = ImagePipeline {
129-
$0.dataLoader = dataLoader
130-
$0.imageCache = imageCache
131-
$0.imageDecoder = { _ in
132-
XCTFail("The pipeline tried to decode the image data")
133-
return ImageDecoder()
134-
}
135-
}
136-
preheater = ImagePreheater(pipeline: pipeline)
137-
}
138-
139-
func testPreheatingIntoDiskCache() {
140-
// Given preheater with .diskCache destination
141-
preheater = ImagePreheater(pipeline: pipeline, destination: .diskCache, maxConcurrentRequestCount: 1)
142-
143-
let expectation = self.expectation(description: "Finished preheating")
144-
preheater.didFinishPreheatingRequest = { _ in
145-
XCTAssertTrue(self.imageCache.images.isEmpty)
146-
expectation.fulfill()
147-
}
148-
149-
preheater.startPreheating(with: [Test.request])
150-
wait()
151-
}
152-
}

0 commit comments

Comments
 (0)