         let expectedLoginURL = URL(string: "https://inkbunny.net/api_login.php")!
         let capturingNetworkAdapter = CapturingNetworkAdapter()
         let inkbunnyAPI = InkbunnyAPI(networkAdapter: capturingNetworkAdapter)
-        inkbunnyAPI.loadHomepage()
+        inkbunnyAPI.loadHomepage(completionHandler: { _ in })
 
         XCTAssertEqual(expectedLoginURL, capturingNetworkAdapter.requestedURL)
     }
 
+    func testAttemptingToFetchHomepageWhereGuestLoginFailsInvokesHandlerWithFailure() {
+        let capturingNetworkAdapter = FailingNetworkAdapter()
+        let inkbunnyAPI = InkbunnyAPI(networkAdapter: capturingNetworkAdapter)
+        let capturingHomepageHandler = CapturingInkbunnyHomepageHandler()
+        inkbunnyAPI.loadHomepage(completionHandler: capturingHomepageHandler.verify)
+
+        XCTAssertTrue(capturingHomepageHandler.wasNotifiedFeedDidFailToLoad)
+    }
+
 }

@testable import Peekazoo
import XCTest

struct InkbunnyAPI {

    var networkAdapter: NetworkAdapter

        self.networkAdapter = networkAdapter
    }

    func loadHomepage(completionHandler: (InkbunnyHomepageLoadResult) -> Void) {
        let loginURL = URL(string: "https://inkbunny.net/api_login.php")!
        networkAdapter.get(loginURL) { _, _ in }
        completionHandler(.failure)
    }

}

class CapturingInkbunnyHomepageHandler {

    private(set) var wasNotifiedFeedDidFailToLoad = false
    func verify(_ result: InkbunnyHomepageLoadResult) {
        switch result {
        case .failure:
            wasNotifiedFeedDidFailToLoad = true
        }
    }

}
