Skip to content

Commit

Permalink
Add force clean cache before button tests
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Jan 4, 2016
1 parent f4c47bc commit 8ab5a7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion KingfisherTests/UIButtonExtensionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class UIButtonExtensionTests: XCTestCase {
let URL = NSURL(string: URLString)!

var progressBlockIsCalled = false

cleanDefaultCache()

button.kf_setImageWithURL(URL, forState: UIControlState.Highlighted, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
progressBlockIsCalled = true
}) { (image, error, cacheType, imageURL) -> () in
Expand All @@ -78,7 +81,7 @@ class UIButtonExtensionTests: XCTestCase {
XCTAssert(image! == testImage, "Downloaded image should be the same as test image.")
XCTAssert(self.button.imageForState(UIControlState.Highlighted)! == testImage, "Downloaded image should be already set to the image for state")
XCTAssert(self.button.kf_webURLForState(UIControlState.Highlighted) == imageURL, "Web URL should equal to the downloaded url.")
XCTAssert(cacheType == .None, "cacheType should be .None since the image was just downloaded.")
XCTAssert(cacheType == .None, "The cache type should be none here. This image was just downloaded. But now is: \(cacheType)")
}
waitForExpectationsWithTimeout(5, handler: nil)
}
Expand Down

0 comments on commit 8ab5a7a

Please sign in to comment.