   
   func testUnknownCacheKeyReturnsNoImage() {
     let expectation = self.expectation(description: "Retrieve no image from cache")
-    let cache = Cache.default
+    cache = Cache.default
     let image = helper.image
     
-    cache.store(image, forKey: "key1") {
-      cache.retrieveImage(forKey: "key2") { image, type in
+    cache.store(image, forKey: "key1") { [cache] in
+      cache!.retrieveImage(forKey: "key2") { image, type in
         XCTAssertNil(image)
         XCTAssertEqual(type, .none)
         expectation.fulfill()


  func testNamedCachesAreDistinct() {
    let expectation = self.expectation(description: "Retrieve image from cache")
    let defaultCache = Cache.default
    let namedCache = Cache(name: "named")
    let image = helper.image
    let key = #function

    defaultCache.store(image, forKey: key) {
      namedCache.retrieveImage(forKey: key, completion: { image, _ in
        XCTAssertNil(image)
        expectation.fulfill()
      })


  func testImagesOnDiskAreMovedToMemory() {
    let expectation = self.expectation(description: "Retrieve image from cache")
    cache = Cache.default
    let image = helper.image
    let key = #function

    cache.store(image, forKey: key) { [cache] in
      cache!.clearMemory()
      cache!.retrieveImage(forKey: key) { _, _ in
        cache!.retrieveImage(forKey: key) { image, type in
          XCTAssertNotNil(image)
          XCTAssertEqual(type, .memory)
          expectation.fulfill()
