Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
isMethodGET()
, isMethodPUT()
, isMethodPOST()
and isMethodDELETE()
to the Swift
helpers.
(#137)tvOS
and watchOS
platforms to the Swift
subspec.OHHTTPStubsResponse
s from NSURL
s that represent file system resources (@MaxGabriel, #129)Swift
subspec that adds helper global functions to ease & make more compact the use of OHHTTPStubs
from Swift 2.0 (#111)If you're using
OHHTTPStubs
in a Swift 2.0 project, it's recommended to addpod 'OHHTTPStubs/Swift
to yourPodfile
so you can use those handy helpers.
OHHTTPStubs
spec has been splitted into multiple subspecs:
pod 'OHHTTPStubs'
in your Podfile
) contains the subspecs Core
, NSURLSession
, JSON
& OHPathHelpers
(so that it matches the features that most people use).HTTPMessage
and Mocktail
(which are opt-in because used by much less people). If you want to use them, you'll need to request them explicitly in your Podfile
using pod 'OHHTTPStubs/Mocktail
for example.NSBundle
, so it's worth testing in that context too)
OHHTTPStubs
in watchOS 2.0 targets.NSURLProtocol
subclass calling NSURLProtocolClient
callbacks from wrong thread. (@nsprogrammer, #96)