Skip to content

Instantly share code, notes, and snippets.

@olbrichj
Created September 1, 2017 09:05
Show Gist options
  • Save olbrichj/7397edfd8124647673aac345659e7304 to your computer and use it in GitHub Desktop.
Save olbrichj/7397edfd8124647673aac345659e7304 to your computer and use it in GitHub Desktop.
import OHHTTPStubs
public func isURL(_ url: URL) -> OHHTTPStubsTestBlock {
return { $0.url == url }
}
extension OHHTTPStubs {
class func setupAuth() {
let response: [String: Any] = ["key": "value"]
stub(condition: isURL("auth.testxyz.com")) { _ in
return OHHTTPStubsResponse(responseObject: response, statusCode: 200, headers: nil)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment