         cache.addFormat(format)
         
         cache.fetch(path: path, formatName: format.name, failure: {_ in
+            XCTFail("expected success")
             expectation.fulfill()
-        }) { _ in
-            XCTFail("expected success")
+        }) {
+            XCTAssertEqual($0, data)
             expectation.fulfill()
         }
         

    
    func testFetchImage_Failure_HNKDiskEntityInvalidDataError() {
        let data = NSData.data()
        data.writeToFile(directoryPath, atomically: true)
        
        let expectation = self.expectationWithDescription(self.name)
        

class DiskFetcherTests: DiskTestCase {
    
    var sut : DiskFetcher<UIImage>!
    var path : String!

    override func setUp() {
        super.setUp()
        path = self.uniquePath()
        sut = DiskFetcher(path: path)
    }
    
    func testInit() {
        XCTAssertEqual(sut.path, path)
    }
    
    func testKey() {
        XCTAssertEqual(sut.key, path)
    }
    
    func testFetchImage_Success() {
        let image = UIImage.imageWithColor(UIColor.greenColor(), CGSizeMake(10, 20))
        let data = UIImagePNGRepresentation(image)
        data.writeToFile(sut.path, atomically: true)
        
        let expectation = self.expectationWithDescription(self.name)
        
