Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
MIT License
Bot releases are hidden (Show)
hasFormBody(_:)
matcher.Published by jeffctown over 4 years ago
Published by jeffctown over 5 years ago
Notes:
- Bumping this version to 7.0.0 because it's now using the Swift 4 APIs.
- This version is still compatible with Swift 3.x when integrating with CocoaPods, as CocoaPods uses the same
SWIFT_VERSION
as your app project does so it adapts automatically and it's transparent for users.- If you're using Carthage and need Swift 3.x compatibility, you can follow the tips in the installation instructions of the
README.md
.- CI is now only testing Swift 4.x on Xcode 9.1 and 10.1.
- Thank you to @hellensoloviy, @robertoferraz, @rckoenes, @NikSativa for their pull requests updating Swift!
Published by jeffctown over 5 years ago
isMethodHEAD()
to the Swift
helpers.hasJsonBody(_:)
matcher.onStubMissing
to report missing stubs.URLRequest.ohhttpStubs_httpBody
function in Swift 3 and 4.isScheme
and isHost
matchers and some documentation in isHost
, isScheme
and isPath
.master
is now compatible with 3.0 and 3.1.pod 'OHHTTPStubs/Swift'
subspec now includes the URLSession
and JSON
subspecs.hasBody(…)
, pathEndsWith(…)
and pathMatches(…)
.Notes:
- Bumping this version to 6.0.0 because it's now using the Swift 3 APIs,
but in practice it's entirely retro-compatible with previous5.2.3-swift3
branch- This version is still compatible with Swift 2.3 when integrating with CocoaPods, as CocoaPods uses the same
SWIFT_VERSION
as your app project does so it adapts automatically and it's transparent for users.- If you're using Carthage though, we stopped providing Swift-2.3-specific branches ourselves (too much maintainance work), but if you still need Swift 2.3 compatibility, you can follow the tips in the installation instructions of the
README.md
.
dynamicType:
vs type(of:)
.This is the same release as 5.2.3 below, except it has SWIFT_VERSION=3.0
set in the Xcode project so that Carthage
users already using Swift 3 can build it with this configuration.
The sample projects also have been updated to Swift 3 in this branch.
Users of CocoaPods
are not impacted by this and can use the main 5.2.3 version — this tag is only useful for Carthage users (until Carthage/#1445 is fixed)
This is the same release as 5.2.2 below, except it has SWIFT_VERSION=3.0
set in the Xcode project so that Carthage
users already using Swift 3 can build it with this configuration.
The sample projects also have been updated to Swift 3 in this branch.
Users of CocoaPods
are not impacted by this and can use the main 5.2.2 version — this tag is only useful for Carthage users (until Carthage/#1445 is fixed)
@discardableResult
to func stub
for swift 3.ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
to avoid embedding Swift standard libraries when building with Carthage.ohhttpStubs_httpBody
to URLRequest
in Swift 3.0.swift3
branch to Swift 3.This is the same release as 5.2.1 below, except it has SWIFT_VERSION=3.0
set in the Xcode project so that Carthage users already using Swift 3 can build it with this configuration.
Users of CocoaPods are not impacted by this and can use the main 5.2.1 version, this tag is only useful for Carthage users (until Carthage/#1445 is fixed)
@escaping
) in the swift-3.0
branch.Reminder that this version is source-compatible compatible with ObjC, Swift 2.2, 2.3 and 3.0 all in master. You you're using CocoaPods you can use 5.2.0 directly. But if you're using Carthage, which builds the framework from the Xcode project, you should use the swift3
branch — whose only diff is the SWIFT_VERSION
build setting being set to 3.0
.
Note for Carthage users: The
OHHTTPStubs.framework.zip
pre-build binary is intentionally not included in this release, because we're in a transition period between Swift 2.2, 2.3 and 3.0. Carthage only let us provide one pre-build binary per version while we'd need one for each Swift ABI during that transition period.
For more info, see the dedicated paragraph in README.
Published by AliSoftware about 8 years ago
This is the same release as 5.2.0 below, except it has SWIFT_VERSION=3.0
set in the Xcode project so that Carthage users already using Swift 3 can build it with this configuration
Published by AliSoftware about 8 years ago
Note for Carthage users: The
OHHTTPStubs.framework.zip
pre-build binary is intentionally not included in this release, because we're in a transition period between Swift 2.2, 2.3 and 3.0. Carthage only let us provide one pre-build binary per version while we'd need one for each Swift ABI during that transition period.
For more info, see the dedicated paragraph in README.
HTTPBody
of POST request when using NSURLSession
pathStartsWith(_:)
to the Swift
helpers.Note that this last change also changed the signature of the onStubActivation:
(hence the bump to 5.0.0
) so you'll have to update your code if you used this for debugging your stubs.
${CURRENT_PROJECT_VERSION}
to the Info.plist
files of theOHHTTPStubs.framework
so it matches what is expected by iTunes Connect.