metatext/Development Assets/Mastodon API Stubs/MastodonTarget+Stubbing.swift

23 lines
509 B
Swift
Raw Normal View History

// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
2020-08-30 23:33:11 +00:00
import Mastodon
2020-08-30 23:59:49 +00:00
extension Target: Stubbing {
func stub(url: URL) -> HTTPStub? {
(endpoint as? Stubbing)?.stub(url: url)
}
func data(url: URL) -> Data? {
(endpoint as? Stubbing)?.data(url: url)
}
func dataString(url: URL) -> String? {
(endpoint as? Stubbing)?.dataString(url: url)
}
func statusCode(url: URL) -> Int? {
(endpoint as? Stubbing)?.statusCode(url: url)
}
}