         XCTAssertTrue(capturingHomepageFeedDelegate.wasNotifiedDidFinishLoading)
     }
 
+    func testFailingToLoadHomepageTellDelegateFeedFailedToLoad() {
+        let failingInkbunnyAPI = FailingInkbunnyAPI()
+        let adapter = InkbunnyAPIAdapter(api: failingInkbunnyAPI)
+        let capturingHomepageFeedDelegate = CapturingHomepageFeedDelegate()
+        adapter.loadFeed(delegate: capturingHomepageFeedDelegate)
+
+        XCTAssertTrue(capturingHomepageFeedDelegate.wasNotifiedFeedDidFailToLoad)
+    }
+
 }


}

struct InkbunnyAPIAdapter: HomepageFeed {

    var api: InkbunnyAPIProtocol

    func loadFeed(delegate: HomepageFeedDelegate) {
        api.loadHomepage { _ in
            delegate.feedDidFinishLoading(items: [])
            delegate.feedDidFailToLoad()
        }
    }

