 
   func testImagesOnDiskAreMovedToMemory() {
     let expectation = self.expectation(description: "Retrieve image from cache")
-    let cache = Cache.default
+    cache = Cache.default
     let image = helper.image
     let key = #function
 
-    cache.store(image, forKey: key) {
-      cache.clearMemory()
-      cache.retrieveImage(forKey: key) { _, _ in
-        cache.retrieveImage(forKey: key) { image, type in
+    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()

class CacheTests: XCTestCase {
  
  private let helper = TestHelper()

  override func tearDown() {
    super.tearDown()

  
  func testItStoresImageInMemory() {
    let expectation = self.expectation(description: "Retrieve image from cache")
    cache = Cache.default
    let image = helper.image
    let key = "http://\(#function)"
    
    cache.store(image, forKey: key) { [cache] in
      cache!.retrieveImage(forKey: key) { image, _ in
        XCTAssertNotNil(image)
        expectation.fulfill()
      }
