 
   func testItReturnsExpiredFileUrlsForDeletion() {
     let expectation = self.expectation(description: "Expired Urls")
-    let cache = Cache(name: #function)
+    cache = Cache(name: #function)
     cache.maxCacheAgeSeconds = 0
     let image = helper.image
     let key = #function
 
-    cache.store(image, forKey: key) {
-      let urls = cache.expiredFileUrls()
+    cache.store(image, forKey: key) { [cache] in
+      let urls = cache!.expiredFileUrls()
       XCTAssertFalse(urls.isEmpty)
       expectation.fulfill()
     }

  
  func testItStoresImagesToDisk() {
    let expectation = self.expectation(description: "Retrieve image from cache")
    let cache = Cache.default
    let image = helper.image
    let key = #function
    
    cache.store(image, forKey: key) {
      cache.clearMemory()
      cache.retrieveImage(forKey: key) { image, type in
        XCTAssertNotNil(image)
        XCTAssertEqual(type, .disk)
        expectation.fulfill()

class CacheTests: XCTestCase {
  
  private let helper = TestHelper()
  
  private var cache: Cache!
  private var namedCache: Cache?

  override func tearDown() {
    super.tearDown()
