├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── Examples ├── ObjC │ ├── MainViewController.h │ ├── MainViewController.m │ ├── MainViewController.xib │ ├── OHHTTPStubsDemo.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── OHHTTPStubsDemo.xcscheme │ ├── OHHTTPStubsDemo.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── WorkspaceSettings.xcsettings │ ├── Podfile │ ├── Podfile.lock │ ├── Pods │ │ ├── Headers │ │ │ ├── Private │ │ │ │ └── OHHTTPStubs │ │ │ │ │ ├── Compatibility.h │ │ │ │ │ ├── HTTPStubs.h │ │ │ │ │ ├── HTTPStubsMethodSwizzling.h │ │ │ │ │ ├── HTTPStubsPathHelpers.h │ │ │ │ │ ├── HTTPStubsResponse+JSON.h │ │ │ │ │ ├── HTTPStubsResponse.h │ │ │ │ │ └── NSURLRequest+HTTPBodyTesting.h │ │ │ └── Public │ │ │ │ └── OHHTTPStubs │ │ │ │ ├── Compatibility.h │ │ │ │ ├── HTTPStubs.h │ │ │ │ ├── HTTPStubsPathHelpers.h │ │ │ │ ├── HTTPStubsResponse+JSON.h │ │ │ │ ├── HTTPStubsResponse.h │ │ │ │ └── NSURLRequest+HTTPBodyTesting.h │ │ ├── Local Podspecs │ │ │ └── OHHTTPStubs.podspec.json │ │ ├── Manifest.lock │ │ ├── Pods.xcodeproj │ │ │ └── project.pbxproj │ │ └── Target Support Files │ │ │ ├── OHHTTPStubs │ │ │ ├── OHHTTPStubs-dummy.m │ │ │ ├── OHHTTPStubs-prefix.pch │ │ │ ├── OHHTTPStubs.debug.xcconfig │ │ │ ├── OHHTTPStubs.release.xcconfig │ │ │ └── OHHTTPStubs.xcconfig │ │ │ └── Pods-OHHTTPStubsDemo │ │ │ ├── Pods-OHHTTPStubsDemo-acknowledgements.markdown │ │ │ ├── Pods-OHHTTPStubsDemo-acknowledgements.plist │ │ │ ├── Pods-OHHTTPStubsDemo-dummy.m │ │ │ ├── Pods-OHHTTPStubsDemo-frameworks.sh │ │ │ ├── Pods-OHHTTPStubsDemo-resources.sh │ │ │ ├── Pods-OHHTTPStubsDemo.debug.xcconfig │ │ │ └── Pods-OHHTTPStubsDemo.release.xcconfig │ └── Supporting Files │ │ ├── Default-568h@2x.png │ │ ├── OHHTTPStubsDemo-Info.plist │ │ ├── OHHTTPStubsDemo-Prefix.pch │ │ └── main.m ├── Stubs │ ├── stub.jpg │ └── stub.txt ├── Swift │ ├── AppDelegate.swift │ ├── Main.storyboard │ ├── MainViewController.swift │ ├── OHHTTPStubsDemo.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── OHHTTPStubsDemo.xcscheme │ ├── OHHTTPStubsDemo.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── WorkspaceSettings.xcsettings │ ├── Podfile │ ├── Podfile.lock │ ├── Pods │ │ ├── Local Podspecs │ │ │ └── OHHTTPStubs.podspec.json │ │ ├── Manifest.lock │ │ ├── Pods.xcodeproj │ │ │ └── project.pbxproj │ │ └── Target Support Files │ │ │ ├── OHHTTPStubs │ │ │ ├── OHHTTPStubs-Info.plist │ │ │ ├── OHHTTPStubs-dummy.m │ │ │ ├── OHHTTPStubs-prefix.pch │ │ │ ├── OHHTTPStubs-umbrella.h │ │ │ ├── OHHTTPStubs.debug.xcconfig │ │ │ ├── OHHTTPStubs.modulemap │ │ │ ├── OHHTTPStubs.release.xcconfig │ │ │ └── OHHTTPStubs.xcconfig │ │ │ └── Pods-OHHTTPStubsDemo │ │ │ ├── Info.plist │ │ │ ├── Pods-OHHTTPStubsDemo-Info.plist │ │ │ ├── Pods-OHHTTPStubsDemo-acknowledgements.markdown │ │ │ ├── Pods-OHHTTPStubsDemo-acknowledgements.plist │ │ │ ├── Pods-OHHTTPStubsDemo-dummy.m │ │ │ ├── Pods-OHHTTPStubsDemo-frameworks.sh │ │ │ ├── Pods-OHHTTPStubsDemo-resources.sh │ │ │ ├── Pods-OHHTTPStubsDemo-umbrella.h │ │ │ ├── Pods-OHHTTPStubsDemo.debug.xcconfig │ │ │ ├── Pods-OHHTTPStubsDemo.modulemap │ │ │ └── Pods-OHHTTPStubsDemo.release.xcconfig │ └── Supporting Files │ │ ├── Default-568h@2x.png │ │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── LaunchScreen.xib └── SwiftPackageManager │ ├── OHHTTPStubsDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── OHHTTPStubsDemo │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── MainViewController.swift │ └── SceneDelegate.swift ├── LICENSE ├── OHHTTPStubs.podspec ├── OHHTTPStubs.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── OHHTTPStubs Mac Framework.xcscheme │ ├── OHHTTPStubs iOS Framework.xcscheme │ ├── OHHTTPStubs iOS StaticLib.xcscheme │ └── OHHTTPStubs tvOS Framework.xcscheme ├── OHHTTPStubs.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── WorkspaceSettings.xcsettings ├── OHHTTPStubsProject.xcconfig ├── Package.swift ├── Package@swift-5.swift ├── Podfile ├── Podfile.lock ├── Pods ├── AFNetworking │ ├── AFNetworking │ │ ├── AFHTTPSessionManager.h │ │ ├── AFHTTPSessionManager.m │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworkReachabilityManager.m │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFSecurityPolicy.m │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLRequestSerialization.m │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLResponseSerialization.m │ │ ├── AFURLSessionManager.h │ │ └── AFURLSessionManager.m │ ├── LICENSE │ ├── README.md │ └── UIKit+AFNetworking │ │ ├── AFAutoPurgingImageCache.h │ │ ├── AFAutoPurgingImageCache.m │ │ ├── AFImageDownloader.h │ │ ├── AFImageDownloader.m │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkActivityIndicatorManager.m │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ ├── UIButton+AFNetworking.h │ │ ├── UIButton+AFNetworking.m │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIImageView+AFNetworking.m │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.m │ │ ├── UIRefreshControl+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.m │ │ ├── UIWebView+AFNetworking.h │ │ └── UIWebView+AFNetworking.m ├── Headers │ ├── Private │ │ └── AFNetworking │ │ │ ├── AFAutoPurgingImageCache.h │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFImageDownloader.h │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLSessionManager.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIImage+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.h │ └── Public │ │ └── AFNetworking │ │ ├── AFAutoPurgingImageCache.h │ │ ├── AFHTTPSessionManager.h │ │ ├── AFImageDownloader.h │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLSessionManager.h │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIButton+AFNetworking.h │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.h │ │ └── UIWebView+AFNetworking.h ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj └── Target Support Files │ ├── AFNetworking-c94d3492 │ ├── AFNetworking-c94d3492-dummy.m │ ├── AFNetworking-c94d3492-prefix.pch │ └── AFNetworking-c94d3492.xcconfig │ ├── AFNetworking-iOS │ ├── AFNetworking-iOS-dummy.m │ ├── AFNetworking-iOS-prefix.pch │ └── AFNetworking-iOS.xcconfig │ ├── AFNetworking-tvOS │ ├── AFNetworking-tvOS-dummy.m │ ├── AFNetworking-tvOS-prefix.pch │ └── AFNetworking-tvOS.xcconfig │ ├── Pods-TestingPods-OHHTTPStubs Mac Tests │ ├── Pods-TestingPods-OHHTTPStubs Mac Tests-acknowledgements.markdown │ ├── Pods-TestingPods-OHHTTPStubs Mac Tests-acknowledgements.plist │ ├── Pods-TestingPods-OHHTTPStubs Mac Tests-dummy.m │ ├── Pods-TestingPods-OHHTTPStubs Mac Tests-frameworks.sh │ ├── Pods-TestingPods-OHHTTPStubs Mac Tests-resources.sh │ ├── Pods-TestingPods-OHHTTPStubs Mac Tests.debug.xcconfig │ └── Pods-TestingPods-OHHTTPStubs Mac Tests.release.xcconfig │ ├── Pods-TestingPods-OHHTTPStubs iOS Fmk Tests │ ├── Pods-TestingPods-OHHTTPStubs iOS Fmk Tests-acknowledgements.markdown │ ├── Pods-TestingPods-OHHTTPStubs iOS Fmk Tests-acknowledgements.plist │ ├── Pods-TestingPods-OHHTTPStubs iOS Fmk Tests-dummy.m │ ├── Pods-TestingPods-OHHTTPStubs iOS Fmk Tests-frameworks.sh │ ├── Pods-TestingPods-OHHTTPStubs iOS Fmk Tests-resources.sh │ ├── Pods-TestingPods-OHHTTPStubs iOS Fmk Tests.debug.xcconfig │ └── Pods-TestingPods-OHHTTPStubs iOS Fmk Tests.release.xcconfig │ ├── Pods-TestingPods-OHHTTPStubs iOS Lib Tests │ ├── Pods-TestingPods-OHHTTPStubs iOS Lib Tests-acknowledgements.markdown │ ├── Pods-TestingPods-OHHTTPStubs iOS Lib Tests-acknowledgements.plist │ ├── Pods-TestingPods-OHHTTPStubs iOS Lib Tests-dummy.m │ ├── Pods-TestingPods-OHHTTPStubs iOS Lib Tests-frameworks.sh │ ├── Pods-TestingPods-OHHTTPStubs iOS Lib Tests-resources.sh │ ├── Pods-TestingPods-OHHTTPStubs iOS Lib Tests.debug.xcconfig │ └── Pods-TestingPods-OHHTTPStubs iOS Lib Tests.release.xcconfig │ └── Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests │ ├── Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests-acknowledgements.markdown │ ├── Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests-acknowledgements.plist │ ├── Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests-dummy.m │ ├── Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests-frameworks.sh │ ├── Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests-resources.sh │ ├── Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests.debug.xcconfig │ └── Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests.release.xcconfig ├── README.md ├── Rakefile ├── Sources ├── HTTPMessage │ ├── HTTPStubsResponse+HTTPMessage.m │ └── include │ │ └── HTTPStubsResponse+HTTPMessage.h ├── Mocktail │ ├── HTTPStubs+Mocktail.m │ └── include │ │ └── HTTPStubs+Mocktail.h ├── OHHTTPStubs │ ├── HTTPStubs+NSURLSessionConfiguration.m │ ├── HTTPStubs.m │ ├── HTTPStubsMethodSwizzling.h │ ├── HTTPStubsMethodSwizzling.m │ ├── HTTPStubsPathHelpers.m │ ├── HTTPStubsResponse+JSON.m │ ├── HTTPStubsResponse.m │ ├── NSURLRequest+HTTPBodyTesting.m │ └── include │ │ ├── Compatibility.h │ │ ├── HTTPStubs.h │ │ ├── HTTPStubsPathHelpers.h │ │ ├── HTTPStubsResponse+JSON.h │ │ ├── HTTPStubsResponse.h │ │ └── NSURLRequest+HTTPBodyTesting.h ├── OHHTTPStubsSwift │ └── OHHTTPStubsSwift.swift └── Supporting Files │ ├── OHHTTPStubs Mac-Info.plist │ ├── OHHTTPStubs iOS-Info.plist │ └── OHHTTPStubs.h └── Tests ├── Fixtures ├── MocktailFolder │ ├── cards.tail │ ├── login.tail │ └── logos_ebay.tail ├── empty.bundle │ └── nothingtoseehere.json ├── emptyfile.json ├── login.tail ├── login_content_type.tail ├── login_content_type_and_headers.tail └── login_headers.tail ├── MocktailTests └── MocktailTests.m ├── OHHTTPStubsSwiftTests └── SwiftHelpersTests.swift ├── OHHTTPStubsTests ├── AFNetworkingTests.m ├── NSURLConnectionDelegateTests.m ├── NSURLConnectionTests.m ├── NSURLSessionTests.m ├── NilValuesTests.m ├── OHPathHelpersTests.m ├── TimingTests.m └── WithContentsOfURLTests.m └── Supporting Files ├── UnitTests-Info.plist └── UnitTests-Prefix.pch /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### New Issue Checklist 4 | 5 | - [ ] I have tried with the latest version of OHHTTPStubs 6 | - [ ] I have read the [README](https://github.com/AliSoftware/OHHTTPStubs/blob/master/README.md) 7 | - [ ] I have read the [Using the right Swift Version of `OHHTTPStubs` for your project](https://github.com/AliSoftware/OHHTTPStubs#using-the-right-swift-version-of-ohhttpstubs-for-your-project) section 8 | - [ ] I have searched in the [existing issues](https://github.com/AliSoftware/OHHTTPStubs/issues?utf8=✓&q=is%3Aissue) 9 | - [ ] I have read [the OHHTTPStubs wiki](https://github.com/AliSoftware/OHHTTPStubs/wiki) to see if there wasn't a detailed page talking about my issue 10 | 11 | ### Environment 12 | 13 | - version of OHHTTPStubs: [LIB VERSION HERE] 14 | - integration method you are using: 15 | * [ ] Cocoapods 16 | * [ ] Carthage 17 | * [ ] submodule 18 | * [ ] other 19 | - version of the tool you use: [INSERT VERSION HERE] 20 | 21 | ### Issue Description 22 | 23 | [DESCRIBE YOUR ISSUE HERE] 24 | 25 | ##### Complete output when you encounter the issue (if any) 26 | 27 | ``` 28 | [INSERT OUTPUT HERE] 29 | ``` 30 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Checklist 4 | 5 | - [ ] I've checked that all new and existing tests pass 6 | - [ ] I've updated the documentation if necessary 7 | - [ ] I've added an entry in the CHANGELOG to credit myself 8 | 9 | ### Description 10 | 11 | 12 | 13 | ### Motivation and Context 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | build/ 3 | .build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | .DS_Store 16 | *.xccheckout 17 | IDEWorkspaceChecks.plist 18 | 19 | # Carthage 20 | Carthage/ 21 | OHHTTPStubs.framework.zip 22 | 23 | # Rubymine 24 | .idea/ 25 | 26 | # SPM 27 | .swiftpm/ 28 | -------------------------------------------------------------------------------- /Examples/ObjC/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.h 3 | // OHHTTPStubsDemo 4 | // 5 | // Created by Olivier Halligon on 11/08/12. 6 | // Copyright (c) 2012 AliSoftware. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/ObjC/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubsDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 57 | 59 | 65 | 66 | 67 | 68 | 74 | 76 | 82 | 83 | 84 | 85 | 87 | 88 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /Examples/ObjC/OHHTTPStubsDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Examples/ObjC/OHHTTPStubsDemo.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Examples/ObjC/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | project 'OHHTTPStubsDemo.xcodeproj' 4 | platform :ios, '11.0' 5 | 6 | target 'OHHTTPStubsDemo' do 7 | pod 'OHHTTPStubs', :path => '../..' 8 | end 9 | -------------------------------------------------------------------------------- /Examples/ObjC/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OHHTTPStubs (9.1.0): 3 | - OHHTTPStubs/Default (= 9.1.0) 4 | - OHHTTPStubs/Core (9.1.0) 5 | - OHHTTPStubs/Default (9.1.0): 6 | - OHHTTPStubs/Core 7 | - OHHTTPStubs/JSON 8 | - OHHTTPStubs/NSURLSession 9 | - OHHTTPStubs/OHPathHelpers 10 | - OHHTTPStubs/JSON (9.1.0): 11 | - OHHTTPStubs/Core 12 | - OHHTTPStubs/NSURLSession (9.1.0): 13 | - OHHTTPStubs/Core 14 | - OHHTTPStubs/OHPathHelpers (9.1.0) 15 | 16 | DEPENDENCIES: 17 | - OHHTTPStubs (from `../..`) 18 | 19 | EXTERNAL SOURCES: 20 | OHHTTPStubs: 21 | :path: "../.." 22 | 23 | SPEC CHECKSUMS: 24 | OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 25 | 26 | PODFILE CHECKSUM: 9a67077a86911aa4a252748903da3d5ea5d5d922 27 | 28 | COCOAPODS: 1.9.3 29 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/Compatibility.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/Compatibility.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/HTTPStubs.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/HTTPStubs.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/HTTPStubsMethodSwizzling.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/HTTPStubsMethodSwizzling.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/HTTPStubsPathHelpers.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/HTTPStubsPathHelpers.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/HTTPStubsResponse+JSON.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/HTTPStubsResponse+JSON.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/HTTPStubsResponse.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/HTTPStubsResponse.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/NSURLRequest+HTTPBodyTesting.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/NSURLRequest+HTTPBodyTesting.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/Compatibility.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/Compatibility.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/HTTPStubs.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/HTTPStubs.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/HTTPStubsPathHelpers.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/HTTPStubsPathHelpers.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/HTTPStubsResponse+JSON.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/HTTPStubsResponse+JSON.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/HTTPStubsResponse.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/HTTPStubsResponse.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/NSURLRequest+HTTPBodyTesting.h: -------------------------------------------------------------------------------- 1 | ../../../../../../Sources/OHHTTPStubs/include/NSURLRequest+HTTPBodyTesting.h -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Local Podspecs/OHHTTPStubs.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "OHHTTPStubs", 3 | "version": "9.1.0", 4 | "summary": "Framework to stub your network requests like HTTP and help you write network unit tests with XCTest.", 5 | "description": "A class to stub network requests easily:\n\n * Test your apps with fake network data (stubbed from file)\n * You can also customize your response headers and status code\n * Use customized stubs depending on the requests\n * Use custom response time to simulate slow network.\n * This works with any request (HTTP, HTTPS, or any protocol) sent using\n the iOS URL Loading System (NSURLConnection, NSURLSession, AFNetworking, …)\n * This is really useful in unit testing, when you need to test network features\n but don't want to hit the real network and fake some response data instead.\n * Has useful convenience methods to stub JSON content or fixture from a file\n * Compatible with Swift", 6 | "homepage": "https://github.com/AliSoftware/OHHTTPStubs", 7 | "license": "MIT", 8 | "authors": { 9 | "Olivier Halligon": "olivier.halligon+ae@gmail.com" 10 | }, 11 | "source": { 12 | "git": "https://github.com/AliSoftware/OHHTTPStubs.git", 13 | "tag": "9.1.0" 14 | }, 15 | "frameworks": [ 16 | "Foundation", 17 | "CFNetwork" 18 | ], 19 | "requires_arc": true, 20 | "platforms": { 21 | "ios": "11.0", 22 | "osx": "10.9", 23 | "watchos": "2.0", 24 | "tvos": "9.0" 25 | }, 26 | "swift_versions": [ 27 | "3.0", 28 | "3.1", 29 | "3.2", 30 | "4.0", 31 | "4.1", 32 | "4.2", 33 | "5.0", 34 | "5.1" 35 | ], 36 | "default_subspecs": "Default", 37 | "subspecs": [ 38 | { 39 | "name": "Default", 40 | "dependencies": { 41 | "OHHTTPStubs/Core": [ 42 | 43 | ], 44 | "OHHTTPStubs/NSURLSession": [ 45 | 46 | ], 47 | "OHHTTPStubs/JSON": [ 48 | 49 | ], 50 | "OHHTTPStubs/OHPathHelpers": [ 51 | 52 | ] 53 | } 54 | }, 55 | { 56 | "name": "Core", 57 | "source_files": [ 58 | "Sources/OHHTTPStubs/**/HTTPStubs.{h,m}", 59 | "Sources/OHHTTPStubs/**/HTTPStubsResponse.{h,m}", 60 | "Sources/OHHTTPStubs/include/Compatibility.h" 61 | ] 62 | }, 63 | { 64 | "name": "NSURLSession", 65 | "dependencies": { 66 | "OHHTTPStubs/Core": [ 67 | 68 | ] 69 | }, 70 | "source_files": [ 71 | "Sources/OHHTTPStubs/**/NSURLRequest+HTTPBodyTesting.{h,m}", 72 | "Sources/OHHTTPStubs/**/HTTPStubs+NSURLSessionConfiguration.{h,m}", 73 | "Sources/OHHTTPStubs/**/HTTPStubsMethodSwizzling.{h,m}" 74 | ], 75 | "private_header_files": "Sources/OHHTTPStubs/**/HTTPStubsMethodSwizzling.h" 76 | }, 77 | { 78 | "name": "JSON", 79 | "dependencies": { 80 | "OHHTTPStubs/Core": [ 81 | 82 | ] 83 | }, 84 | "source_files": "Sources/OHHTTPStubs/**/HTTPStubsResponse+JSON.{h,m}" 85 | }, 86 | { 87 | "name": "HTTPMessage", 88 | "dependencies": { 89 | "OHHTTPStubs/Core": [ 90 | 91 | ] 92 | }, 93 | "source_files": "Sources/HTTPMessage/**/*.{h,m}" 94 | }, 95 | { 96 | "name": "Mocktail", 97 | "dependencies": { 98 | "OHHTTPStubs/Core": [ 99 | 100 | ] 101 | }, 102 | "source_files": "Sources/Mocktail/**/*.{h,m}" 103 | }, 104 | { 105 | "name": "OHPathHelpers", 106 | "source_files": [ 107 | "Sources/OHHTTPStubs/**/HTTPStubsPathHelpers.{h,m}", 108 | "Sources/OHHTTPStubs/include/Compatibility.h" 109 | ] 110 | }, 111 | { 112 | "name": "Swift", 113 | "platforms": { 114 | "ios": "11.0", 115 | "osx": "10.9", 116 | "watchos": "2.0", 117 | "tvos": "9.0" 118 | }, 119 | "dependencies": { 120 | "OHHTTPStubs/Default": [ 121 | 122 | ] 123 | }, 124 | "source_files": "Sources/OHHTTPStubsSwift/*.swift" 125 | } 126 | ], 127 | "swift_version": "5.1" 128 | } 129 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OHHTTPStubs (9.1.0): 3 | - OHHTTPStubs/Default (= 9.1.0) 4 | - OHHTTPStubs/Core (9.1.0) 5 | - OHHTTPStubs/Default (9.1.0): 6 | - OHHTTPStubs/Core 7 | - OHHTTPStubs/JSON 8 | - OHHTTPStubs/NSURLSession 9 | - OHHTTPStubs/OHPathHelpers 10 | - OHHTTPStubs/JSON (9.1.0): 11 | - OHHTTPStubs/Core 12 | - OHHTTPStubs/NSURLSession (9.1.0): 13 | - OHHTTPStubs/Core 14 | - OHHTTPStubs/OHPathHelpers (9.1.0) 15 | 16 | DEPENDENCIES: 17 | - OHHTTPStubs (from `../..`) 18 | 19 | EXTERNAL SOURCES: 20 | OHHTTPStubs: 21 | :path: "../.." 22 | 23 | SPEC CHECKSUMS: 24 | OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 25 | 26 | PODFILE CHECKSUM: 9a67077a86911aa4a252748903da3d5ea5d5d922 27 | 28 | COCOAPODS: 1.9.3 29 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_OHHTTPStubs : NSObject 3 | @end 4 | @implementation PodsDummy_OHHTTPStubs 5 | @end 6 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/OHHTTPStubs" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/OHHTTPStubs" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/OHHTTPStubs" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## OHHTTPStubs 5 | 6 | - MIT LICENSE - 7 | 8 | Copyright (c) 2012 Olivier Halligon 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | Generated by CocoaPods - https://cocoapods.org 16 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | - MIT LICENSE - 18 | 19 | Copyright (c) 2012 Olivier Halligon 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 22 | 23 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | License 27 | MIT 28 | Title 29 | OHHTTPStubs 30 | Type 31 | PSGroupSpecifier 32 | 33 | 34 | FooterText 35 | Generated by CocoaPods - https://cocoapods.org 36 | Title 37 | 38 | Type 39 | PSGroupSpecifier 40 | 41 | 42 | StringsTable 43 | Acknowledgements 44 | Title 45 | Acknowledgements 46 | 47 | 48 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_OHHTTPStubsDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_OHHTTPStubsDemo 5 | @end 6 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"OHHTTPStubs" -framework "CFNetwork" -framework "Foundation" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"OHHTTPStubs" -framework "CFNetwork" -framework "Foundation" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Examples/ObjC/Supporting Files/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AliSoftware/OHHTTPStubs/c582400a38590a3dabb4353416d9d46cb7278d06/Examples/ObjC/Supporting Files/Default-568h@2x.png -------------------------------------------------------------------------------- /Examples/ObjC/Supporting Files/OHHTTPStubsDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainViewController 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Examples/ObjC/Supporting Files/OHHTTPStubsDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OHHTTPStubsDemo' target in the 'OHHTTPStubsDemo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Examples/ObjC/Supporting Files/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OHHTTPStubsDemo 4 | // 5 | // Created by Olivier Halligon on 11/08/12. 6 | // Copyright (c) 2012 AliSoftware. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, nil); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Examples/Stubs/stub.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AliSoftware/OHHTTPStubs/c582400a38590a3dabb4353416d9d46cb7278d06/Examples/Stubs/stub.jpg -------------------------------------------------------------------------------- /Examples/Stubs/stub.txt: -------------------------------------------------------------------------------- 1 | This is the text from your stub. 2 | 3 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim ad minim veniam, quis nostrud exerci tution ullam corper suscipit lobortis nisi ut aliquip ex ea commodo consequat. Duis te feugi facilisi. Duis autem dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit au gue duis dolore te feugat nulla facilisi. 4 | -------------------------------------------------------------------------------- /Examples/Swift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // OHHTTPStubsDemo 4 | // 5 | // Created by Olivier Halligon on 18/04/2015. 6 | // Copyright (c) 2015 AliSoftware. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | #if swift(>=4) 12 | #else 13 | extension UIApplication { 14 | typealias LaunchOptionsKey = UIApplicationLaunchOptionsKey 15 | } 16 | #endif 17 | 18 | @UIApplicationMain 19 | class AppDelegate: UIResponder, UIApplicationDelegate { 20 | 21 | var window: UIWindow? 22 | 23 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 24 | // Override point for customization after application launch. 25 | return true 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/Swift/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubsDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 58 | 60 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Examples/Swift/OHHTTPStubsDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Examples/Swift/OHHTTPStubsDemo.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Examples/Swift/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | project 'OHHTTPStubsDemo.xcodeproj' 4 | platform :ios, '11.0' 5 | use_frameworks! 6 | 7 | target 'OHHTTPStubsDemo' do 8 | pod 'OHHTTPStubs', :path => '../..' 9 | pod 'OHHTTPStubs/Swift', :path => '../..' 10 | end 11 | -------------------------------------------------------------------------------- /Examples/Swift/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OHHTTPStubs (9.1.0): 3 | - OHHTTPStubs/Default (= 9.1.0) 4 | - OHHTTPStubs/Core (9.1.0) 5 | - OHHTTPStubs/Default (9.1.0): 6 | - OHHTTPStubs/Core 7 | - OHHTTPStubs/JSON 8 | - OHHTTPStubs/NSURLSession 9 | - OHHTTPStubs/OHPathHelpers 10 | - OHHTTPStubs/JSON (9.1.0): 11 | - OHHTTPStubs/Core 12 | - OHHTTPStubs/NSURLSession (9.1.0): 13 | - OHHTTPStubs/Core 14 | - OHHTTPStubs/OHPathHelpers (9.1.0) 15 | - OHHTTPStubs/Swift (9.1.0): 16 | - OHHTTPStubs/Default 17 | 18 | DEPENDENCIES: 19 | - OHHTTPStubs (from `../..`) 20 | - OHHTTPStubs/Swift (from `../..`) 21 | 22 | EXTERNAL SOURCES: 23 | OHHTTPStubs: 24 | :path: "../.." 25 | 26 | SPEC CHECKSUMS: 27 | OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 28 | 29 | PODFILE CHECKSUM: 7da7c441ea9ff6f06b633c908b7a7294805f5602 30 | 31 | COCOAPODS: 1.9.3 32 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Local Podspecs/OHHTTPStubs.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "OHHTTPStubs", 3 | "version": "9.1.0", 4 | "summary": "Framework to stub your network requests like HTTP and help you write network unit tests with XCTest.", 5 | "description": "A class to stub network requests easily:\n\n * Test your apps with fake network data (stubbed from file)\n * You can also customize your response headers and status code\n * Use customized stubs depending on the requests\n * Use custom response time to simulate slow network.\n * This works with any request (HTTP, HTTPS, or any protocol) sent using\n the iOS URL Loading System (NSURLConnection, NSURLSession, AFNetworking, …)\n * This is really useful in unit testing, when you need to test network features\n but don't want to hit the real network and fake some response data instead.\n * Has useful convenience methods to stub JSON content or fixture from a file\n * Compatible with Swift", 6 | "homepage": "https://github.com/AliSoftware/OHHTTPStubs", 7 | "license": "MIT", 8 | "authors": { 9 | "Olivier Halligon": "olivier.halligon+ae@gmail.com" 10 | }, 11 | "source": { 12 | "git": "https://github.com/AliSoftware/OHHTTPStubs.git", 13 | "tag": "9.1.0" 14 | }, 15 | "frameworks": [ 16 | "Foundation", 17 | "CFNetwork" 18 | ], 19 | "requires_arc": true, 20 | "platforms": { 21 | "ios": "11.0", 22 | "osx": "10.9", 23 | "watchos": "2.0", 24 | "tvos": "9.0" 25 | }, 26 | "swift_versions": [ 27 | "3.0", 28 | "3.1", 29 | "3.2", 30 | "4.0", 31 | "4.1", 32 | "4.2", 33 | "5.0", 34 | "5.1" 35 | ], 36 | "default_subspecs": "Default", 37 | "subspecs": [ 38 | { 39 | "name": "Default", 40 | "dependencies": { 41 | "OHHTTPStubs/Core": [ 42 | 43 | ], 44 | "OHHTTPStubs/NSURLSession": [ 45 | 46 | ], 47 | "OHHTTPStubs/JSON": [ 48 | 49 | ], 50 | "OHHTTPStubs/OHPathHelpers": [ 51 | 52 | ] 53 | } 54 | }, 55 | { 56 | "name": "Core", 57 | "source_files": [ 58 | "Sources/OHHTTPStubs/**/HTTPStubs.{h,m}", 59 | "Sources/OHHTTPStubs/**/HTTPStubsResponse.{h,m}", 60 | "Sources/OHHTTPStubs/include/Compatibility.h" 61 | ] 62 | }, 63 | { 64 | "name": "NSURLSession", 65 | "dependencies": { 66 | "OHHTTPStubs/Core": [ 67 | 68 | ] 69 | }, 70 | "source_files": [ 71 | "Sources/OHHTTPStubs/**/NSURLRequest+HTTPBodyTesting.{h,m}", 72 | "Sources/OHHTTPStubs/**/HTTPStubs+NSURLSessionConfiguration.{h,m}", 73 | "Sources/OHHTTPStubs/**/HTTPStubsMethodSwizzling.{h,m}" 74 | ], 75 | "private_header_files": "Sources/OHHTTPStubs/**/HTTPStubsMethodSwizzling.h" 76 | }, 77 | { 78 | "name": "JSON", 79 | "dependencies": { 80 | "OHHTTPStubs/Core": [ 81 | 82 | ] 83 | }, 84 | "source_files": "Sources/OHHTTPStubs/**/HTTPStubsResponse+JSON.{h,m}" 85 | }, 86 | { 87 | "name": "HTTPMessage", 88 | "dependencies": { 89 | "OHHTTPStubs/Core": [ 90 | 91 | ] 92 | }, 93 | "source_files": "Sources/HTTPMessage/**/*.{h,m}" 94 | }, 95 | { 96 | "name": "Mocktail", 97 | "dependencies": { 98 | "OHHTTPStubs/Core": [ 99 | 100 | ] 101 | }, 102 | "source_files": "Sources/Mocktail/**/*.{h,m}" 103 | }, 104 | { 105 | "name": "OHPathHelpers", 106 | "source_files": [ 107 | "Sources/OHHTTPStubs/**/HTTPStubsPathHelpers.{h,m}", 108 | "Sources/OHHTTPStubs/include/Compatibility.h" 109 | ] 110 | }, 111 | { 112 | "name": "Swift", 113 | "platforms": { 114 | "ios": "11.0", 115 | "osx": "10.9", 116 | "watchos": "2.0", 117 | "tvos": "9.0" 118 | }, 119 | "dependencies": { 120 | "OHHTTPStubs/Default": [ 121 | 122 | ] 123 | }, 124 | "source_files": "Sources/OHHTTPStubsSwift/*.swift" 125 | } 126 | ], 127 | "swift_version": "5.1" 128 | } 129 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OHHTTPStubs (9.1.0): 3 | - OHHTTPStubs/Default (= 9.1.0) 4 | - OHHTTPStubs/Core (9.1.0) 5 | - OHHTTPStubs/Default (9.1.0): 6 | - OHHTTPStubs/Core 7 | - OHHTTPStubs/JSON 8 | - OHHTTPStubs/NSURLSession 9 | - OHHTTPStubs/OHPathHelpers 10 | - OHHTTPStubs/JSON (9.1.0): 11 | - OHHTTPStubs/Core 12 | - OHHTTPStubs/NSURLSession (9.1.0): 13 | - OHHTTPStubs/Core 14 | - OHHTTPStubs/OHPathHelpers (9.1.0) 15 | - OHHTTPStubs/Swift (9.1.0): 16 | - OHHTTPStubs/Default 17 | 18 | DEPENDENCIES: 19 | - OHHTTPStubs (from `../..`) 20 | - OHHTTPStubs/Swift (from `../..`) 21 | 22 | EXTERNAL SOURCES: 23 | OHHTTPStubs: 24 | :path: "../.." 25 | 26 | SPEC CHECKSUMS: 27 | OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 28 | 29 | PODFILE CHECKSUM: 7da7c441ea9ff6f06b633c908b7a7294805f5602 30 | 31 | COCOAPODS: 1.9.3 32 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 9.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_OHHTTPStubs : NSObject 3 | @end 4 | @implementation PodsDummy_OHHTTPStubs 5 | @end 6 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "HTTPStubs.h" 14 | #import "HTTPStubsResponse.h" 15 | #import "Compatibility.h" 16 | #import "HTTPStubsResponse+JSON.h" 17 | #import "NSURLRequest+HTTPBodyTesting.h" 18 | #import "HTTPStubsPathHelpers.h" 19 | #import "Compatibility.h" 20 | 21 | FOUNDATION_EXPORT double OHHTTPStubsVersionNumber; 22 | FOUNDATION_EXPORT const unsigned char OHHTTPStubsVersionString[]; 23 | 24 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Foundation" 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../.. 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.modulemap: -------------------------------------------------------------------------------- 1 | framework module OHHTTPStubs { 2 | umbrella header "OHHTTPStubs-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Foundation" 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../.. 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Foundation" 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../.. 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## OHHTTPStubs 5 | 6 | - MIT LICENSE - 7 | 8 | Copyright (c) 2012 Olivier Halligon 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | Generated by CocoaPods - https://cocoapods.org 16 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | - MIT LICENSE - 18 | 19 | Copyright (c) 2012 Olivier Halligon 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 22 | 23 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | License 27 | MIT 28 | Title 29 | OHHTTPStubs 30 | Type 31 | PSGroupSpecifier 32 | 33 | 34 | FooterText 35 | Generated by CocoaPods - https://cocoapods.org 36 | Title 37 | 38 | Type 39 | PSGroupSpecifier 40 | 41 | 42 | StringsTable 43 | Acknowledgements 44 | Title 45 | Acknowledgements 46 | 47 | 48 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_OHHTTPStubsDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_OHHTTPStubsDemo 5 | @end 6 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_OHHTTPStubsDemoVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_OHHTTPStubsDemoVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs/OHHTTPStubs.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Foundation" -framework "OHHTTPStubs" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_OHHTTPStubsDemo { 2 | umbrella header "Pods-OHHTTPStubsDemo-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs/OHHTTPStubs.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Foundation" -framework "OHHTTPStubs" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Examples/Swift/Supporting Files/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AliSoftware/OHHTTPStubs/c582400a38590a3dabb4353416d9d46cb7278d06/Examples/Swift/Supporting Files/Default-568h@2x.png -------------------------------------------------------------------------------- /Examples/Swift/Supporting Files/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Examples/Swift/Supporting Files/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Examples/Swift/Supporting Files/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Examples/SwiftPackageManager/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/SwiftPackageManager/OHHTTPStubsDemo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // OHHTTPStubsDemo 4 | // 5 | // Created by Olivier Halligon on 18/04/2015. 6 | // Copyright (c) 2015 AliSoftware. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | var window: UIWindow? 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | return true 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Examples/SwiftPackageManager/OHHTTPStubsDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Examples/SwiftPackageManager/OHHTTPStubsDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Examples/SwiftPackageManager/OHHTTPStubsDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Examples/SwiftPackageManager/OHHTTPStubsDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | UISceneStoryboardFile 37 | Main 38 | 39 | 40 | 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIMainStoryboardFile 45 | Main 46 | UIRequiredDeviceCapabilities 47 | 48 | armv7 49 | 50 | UISupportedInterfaceOrientations 51 | 52 | UIInterfaceOrientationPortrait 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | UISupportedInterfaceOrientations~ipad 57 | 58 | UIInterfaceOrientationPortrait 59 | UIInterfaceOrientationPortraitUpsideDown 60 | UIInterfaceOrientationLandscapeLeft 61 | UIInterfaceOrientationLandscapeRight 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Examples/SwiftPackageManager/OHHTTPStubsDemo/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // OHHTTPStubsDemo 4 | // 5 | // Created by Jeff Lett on 8/10/19. 6 | // Copyright © 2019 AliSoftware. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 12 | 13 | var window: UIWindow? 14 | 15 | 16 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 17 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 18 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 19 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 20 | guard let _ = (scene as? UIWindowScene) else { return } 21 | } 22 | 23 | func sceneDidDisconnect(_ scene: UIScene) { 24 | // Called as the scene is being released by the system. 25 | // This occurs shortly after the scene enters the background, or when its session is discarded. 26 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 27 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 28 | } 29 | 30 | func sceneDidBecomeActive(_ scene: UIScene) { 31 | // Called when the scene has moved from an inactive state to an active state. 32 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 33 | } 34 | 35 | func sceneWillResignActive(_ scene: UIScene) { 36 | // Called when the scene will move from an active state to an inactive state. 37 | // This may occur due to temporary interruptions (ex. an incoming phone call). 38 | } 39 | 40 | func sceneWillEnterForeground(_ scene: UIScene) { 41 | // Called as the scene transitions from the background to the foreground. 42 | // Use this method to undo the changes made on entering the background. 43 | } 44 | 45 | func sceneDidEnterBackground(_ scene: UIScene) { 46 | // Called as the scene transitions from the foreground to the background. 47 | // Use this method to save data, release shared resources, and store enough scene-specific state information 48 | // to restore the scene back to its current state. 49 | } 50 | 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | - MIT LICENSE - 2 | 3 | Copyright (c) 2012 Olivier Halligon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /OHHTTPStubs.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "OHHTTPStubs" 4 | s.version = "9.1.0" 5 | 6 | s.summary = "Framework to stub your network requests like HTTP and help you write network unit tests with XCTest." 7 | s.description = <<-DESC.gsub(/^ +\|/,'') 8 | |A class to stub network requests easily: 9 | | 10 | | * Test your apps with fake network data (stubbed from file) 11 | | * You can also customize your response headers and status code 12 | | * Use customized stubs depending on the requests 13 | | * Use custom response time to simulate slow network. 14 | | * This works with any request (HTTP, HTTPS, or any protocol) sent using 15 | | the iOS URL Loading System (NSURLConnection, NSURLSession, AFNetworking, …) 16 | | * This is really useful in unit testing, when you need to test network features 17 | | but don't want to hit the real network and fake some response data instead. 18 | | * Has useful convenience methods to stub JSON content or fixture from a file 19 | | * Compatible with Swift 20 | DESC 21 | 22 | s.homepage = "https://github.com/AliSoftware/OHHTTPStubs" 23 | s.license = "MIT" 24 | s.authors = { 'Olivier Halligon' => 'olivier.halligon+ae@gmail.com' } 25 | 26 | s.source = { :git => "https://github.com/AliSoftware/OHHTTPStubs.git", :tag => s.version.to_s } 27 | 28 | s.frameworks = 'Foundation', 'CFNetwork' 29 | 30 | s.requires_arc = true 31 | s.ios.deployment_target = '11.0' 32 | s.osx.deployment_target = '10.9' 33 | s.watchos.deployment_target = '2.0' 34 | s.tvos.deployment_target = '9.0' 35 | s.swift_versions = ['3.0', '3.1', '3.2', '4.0', '4.1', '4.2', '5.0', '5.1'] 36 | 37 | s.default_subspec = 'Default' 38 | # Default subspec that includes the most commonly-used components 39 | s.subspec 'Default' do |default| 40 | default.dependency 'OHHTTPStubs/Core' 41 | default.dependency 'OHHTTPStubs/NSURLSession' 42 | default.dependency 'OHHTTPStubs/JSON' 43 | default.dependency 'OHHTTPStubs/OHPathHelpers' 44 | end 45 | 46 | # The Core subspec, containing the library core needed in all cases 47 | s.subspec 'Core' do |core| 48 | core.source_files = "Sources/OHHTTPStubs/**/HTTPStubs.{h,m}", "Sources/OHHTTPStubs/**/HTTPStubsResponse.{h,m}", 49 | "Sources/OHHTTPStubs/include/Compatibility.h" 50 | end 51 | 52 | # Optional subspecs 53 | s.subspec 'NSURLSession' do |urlsession| 54 | urlsession.dependency 'OHHTTPStubs/Core' 55 | urlsession.source_files = "Sources/OHHTTPStubs/**/NSURLRequest+HTTPBodyTesting.{h,m}", "Sources/OHHTTPStubs/**/HTTPStubs+NSURLSessionConfiguration.{h,m}", "Sources/OHHTTPStubs/**/HTTPStubsMethodSwizzling.{h,m}" 56 | urlsession.private_header_files = "Sources/OHHTTPStubs/**/HTTPStubsMethodSwizzling.h" 57 | end 58 | 59 | s.subspec 'JSON' do |json| 60 | json.dependency 'OHHTTPStubs/Core' 61 | json.source_files = "Sources/OHHTTPStubs/**/HTTPStubsResponse+JSON.{h,m}" 62 | end 63 | 64 | s.subspec 'HTTPMessage' do |httpmessage| 65 | httpmessage.dependency 'OHHTTPStubs/Core' 66 | httpmessage.source_files = "Sources/HTTPMessage/**/*.{h,m}" 67 | end 68 | 69 | s.subspec 'Mocktail' do |mocktail| 70 | mocktail.dependency 'OHHTTPStubs/Core' 71 | mocktail.source_files = "Sources/Mocktail/**/*.{h,m}" 72 | end 73 | 74 | s.subspec 'OHPathHelpers' do |pathhelper| 75 | pathhelper.source_files = "Sources/OHHTTPStubs/**/HTTPStubsPathHelpers.{h,m}", "Sources/OHHTTPStubs/include/Compatibility.h" 76 | end 77 | 78 | s.subspec 'Swift' do |swift| 79 | swift.ios.deployment_target = '11.0' 80 | swift.osx.deployment_target = '10.9' 81 | swift.watchos.deployment_target = '2.0' 82 | swift.tvos.deployment_target = '9.0' 83 | 84 | swift.dependency 'OHHTTPStubs/Default' 85 | swift.source_files = "Sources/OHHTTPStubsSwift/*.swift" 86 | end 87 | 88 | end 89 | -------------------------------------------------------------------------------- /OHHTTPStubs.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs Mac Framework.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 69 | 70 | 76 | 77 | 78 | 79 | 80 | 81 | 87 | 88 | 90 | 91 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS StaticLib.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 79 | 85 | 86 | 87 | 88 | 89 | 90 | 96 | 97 | 103 | 104 | 105 | 106 | 108 | 109 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /OHHTTPStubs.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 19 | 20 | 22 | 23 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /OHHTTPStubs.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OHHTTPStubsProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // OHHTTPStubsProject.xcconfig 3 | // OHHTTPStubs 4 | // 5 | // Created by Jeff Lett on 3/7/19. 6 | // Copyright © 2019 AliSoftware. All rights reserved. 7 | // 8 | 9 | // Configuration settings file format documentation can be found at: 10 | // https://help.apple.com/xcode/#/dev745c5c974 11 | 12 | // These build settings are used to disable specific unit tests. 13 | // They can and should be overridden when running tests in CI using an xcodebuild argument. 14 | 15 | 16 | // xcodebuild Example: 17 | // xcodebuild -workspace OHHTTPStubs/OHHTTPStubs.xcworkspace -scheme "OHHTTPStubs iOS StaticLib" -sdk iphonesimulator -configuration Debug ONLY_ACTIVE_ARCH=NO OHHTTPSTUBS_SKIP_TIMING_TESTS=1 -destination 'name=iPhone 7,OS=latest' clean build test 18 | // 19 | // rake Example: 20 | // rake ios['iOS StaticLib','latest','build-for-testing test-without-building',"OHHTTPSTUBS_SKIP_TIMING_TESTS=1"] 21 | OHHTTPSTUBS_SKIP_TIMING_TESTS=0 22 | 23 | // xcodebuild Example: 24 | // xcodebuild -workspace OHHTTPStubs/OHHTTPStubs.xcworkspace -scheme "OHHTTPStubs iOS StaticLib" -sdk iphonesimulator -configuration Debug ONLY_ACTIVE_ARCH=NO OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1 -destination 'name=iPhone 7,OS=latest' clean build test 25 | // 26 | // rake Example: 27 | // rake ios['iOS StaticLib','latest','build-for-testing test-without-building',"OHHTTPSTUBS_SKIP_REDIRECT_TESTS=1"] 28 | OHHTTPSTUBS_SKIP_REDIRECT_TESTS=0 29 | 30 | GCC_PREPROCESSOR_DEFINITIONS=$(inherited) OHHTTPSTUBS_SKIP_TIMING_TESTS=$(OHHTTPSTUBS_SKIP_TIMING_TESTS) OHHTTPSTUBS_SKIP_REDIRECT_TESTS=$(OHHTTPSTUBS_SKIP_REDIRECT_TESTS) 31 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.0 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "OHHTTPStubs", 6 | products: [ 7 | .library( 8 | name: "OHHTTPStubs", 9 | targets: [ 10 | "OHHTTPStubs", 11 | ] 12 | ), 13 | .library( 14 | name: "OHHTTPStubsSwift", 15 | targets: [ 16 | "OHHTTPStubs", 17 | "OHHTTPStubsSwift" 18 | ] 19 | ) 20 | ], 21 | dependencies: [ 22 | ], 23 | targets: [ 24 | .target( 25 | name: "OHHTTPStubs", 26 | dependencies: []), 27 | .testTarget( 28 | name: "OHHTTPStubsTests", 29 | dependencies: ["OHHTTPStubs"]), 30 | .target( 31 | name: "OHHTTPStubsSwift", 32 | dependencies: ["OHHTTPStubs"]), 33 | .testTarget( 34 | name: "OHHTTPStubsSwiftTests", 35 | dependencies: ["OHHTTPStubsSwift", "OHHTTPStubs"] 36 | ) 37 | ] 38 | ) 39 | -------------------------------------------------------------------------------- /Package@swift-5.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "OHHTTPStubs", 6 | platforms: [ 7 | .macOS(.v10_10), .iOS(.v11), .watchOS(.v2), .tvOS(.v9) 8 | ], 9 | products: [ 10 | .library( 11 | name: "OHHTTPStubs", 12 | targets: [ 13 | "OHHTTPStubs", 14 | ] 15 | ), 16 | .library( 17 | name: "OHHTTPStubsSwift", 18 | targets: [ 19 | "OHHTTPStubs", 20 | "OHHTTPStubsSwift" 21 | ] 22 | ) 23 | ], 24 | dependencies: [ 25 | ], 26 | targets: [ 27 | .target( 28 | name: "OHHTTPStubs", 29 | dependencies: []), 30 | .testTarget( 31 | name: "OHHTTPStubsTests", 32 | dependencies: ["OHHTTPStubs"]), 33 | .target( 34 | name: "OHHTTPStubsSwift", 35 | dependencies: ["OHHTTPStubs"]), 36 | .testTarget( 37 | name: "OHHTTPStubsSwiftTests", 38 | dependencies: ["OHHTTPStubsSwift", "OHHTTPStubs"] 39 | ) 40 | ] 41 | ) 42 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | project 'OHHTTPStubs.xcodeproj' 4 | inhibit_all_warnings! 5 | 6 | abstract_target 'TestingPods' do 7 | pod 'AFNetworking', '~> 3.0' 8 | 9 | target 'OHHTTPStubs iOS Lib Tests' do 10 | platform :ios, '11.0' 11 | end 12 | 13 | target 'OHHTTPStubs iOS Fmk Tests' do 14 | platform :ios, '11.0' 15 | end 16 | 17 | target 'OHHTTPStubs Mac Tests' do 18 | platform :osx, '10.9' 19 | end 20 | 21 | target 'OHHTTPStubs tvOS Fmk Tests' do 22 | platform :tvos, '9.0' 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.0.4): 3 | - AFNetworking/NSURLSession (= 3.0.4) 4 | - AFNetworking/Reachability (= 3.0.4) 5 | - AFNetworking/Security (= 3.0.4) 6 | - AFNetworking/Serialization (= 3.0.4) 7 | - AFNetworking/UIKit (= 3.0.4) 8 | - AFNetworking/NSURLSession (3.0.4): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.0.4) 13 | - AFNetworking/Security (3.0.4) 14 | - AFNetworking/Serialization (3.0.4) 15 | - AFNetworking/UIKit (3.0.4): 16 | - AFNetworking/NSURLSession 17 | 18 | DEPENDENCIES: 19 | - AFNetworking (~> 3.0) 20 | 21 | SPEC REPOS: 22 | https://github.com/cocoapods/specs.git: 23 | - AFNetworking 24 | 25 | SPEC CHECKSUMS: 26 | AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93 27 | 28 | PODFILE CHECKSUM: 8d0eff399cf1d98e2ff7220113aed7a0d13ff37d 29 | 30 | COCOAPODS: 1.6.0.beta.2 31 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | #import 26 | 27 | #ifndef _AFNETWORKING_ 28 | #define _AFNETWORKING_ 29 | 30 | #import "AFURLRequestSerialization.h" 31 | #import "AFURLResponseSerialization.h" 32 | #import "AFSecurityPolicy.h" 33 | 34 | #if !TARGET_OS_WATCH 35 | #import "AFNetworkReachabilityManager.h" 36 | #endif 37 | 38 | #import "AFURLSessionManager.h" 39 | #import "AFHTTPSessionManager.h" 40 | 41 | #endif /* _AFNETWORKING_ */ 42 | -------------------------------------------------------------------------------- /Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | /** 31 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task. 32 | */ 33 | @interface UIActivityIndicatorView (AFNetworking) 34 | 35 | ///---------------------------------- 36 | /// @name Animating for Session Tasks 37 | ///---------------------------------- 38 | 39 | /** 40 | Binds the animating state to the state of the specified task. 41 | 42 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 43 | */ 44 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 45 | 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #if TARGET_OS_IOS || TARGET_OS_TV 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #if TARGET_OS_IOS 30 | #import "AFAutoPurgingImageCache.h" 31 | #import "AFImageDownloader.h" 32 | #import "AFNetworkActivityIndicatorManager.h" 33 | #import "UIRefreshControl+AFNetworking.h" 34 | #import "UIWebView+AFNetworking.h" 35 | #endif 36 | 37 | #import "UIActivityIndicatorView+AFNetworking.h" 38 | #import "UIButton+AFNetworking.h" 39 | #import "UIImageView+AFNetworking.h" 40 | #import "UIProgressView+AFNetworking.h" 41 | #endif /* _UIKIT_AFNETWORKING_ */ 42 | #endif 43 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task. 35 | */ 36 | @interface UIProgressView (AFNetworking) 37 | 38 | ///------------------------------------ 39 | /// @name Setting Session Task Progress 40 | ///------------------------------------ 41 | 42 | /** 43 | Binds the progress to the upload progress of the specified session task. 44 | 45 | @param task The session task. 46 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 47 | */ 48 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 49 | animated:(BOOL)animated; 50 | 51 | /** 52 | Binds the progress to the download progress of the specified session task. 53 | 54 | @param task The session task. 55 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 56 | */ 57 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 58 | animated:(BOOL)animated; 59 | 60 | @end 61 | 62 | NS_ASSUME_NONNULL_END 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2014 AFNetworking (http://afnetworking.com) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | #import 26 | 27 | #if TARGET_OS_IOS 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task. 35 | */ 36 | @interface UIRefreshControl (AFNetworking) 37 | 38 | ///----------------------------------- 39 | /// @name Refreshing for Session Tasks 40 | ///----------------------------------- 41 | 42 | /** 43 | Binds the refreshing state to the state of the specified task. 44 | 45 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 46 | */ 47 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFHTTPSessionManager; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. 36 | 37 | @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. 38 | */ 39 | @interface UIWebView (AFNetworking) 40 | 41 | /** 42 | The session manager used to download all requests. 43 | */ 44 | @property (nonatomic, strong) AFHTTPSessionManager *sessionManager; 45 | 46 | /** 47 | Asynchronously loads the specified request. 48 | 49 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 50 | @param progress A progress object monitoring the current download progress. 51 | @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. 52 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 53 | */ 54 | - (void)loadRequest:(NSURLRequest *)request 55 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 56 | success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 57 | failure:(nullable void (^)(NSError *error))failure; 58 | 59 | /** 60 | Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. 61 | 62 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 63 | @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. 64 | @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. 65 | @param progress A progress object monitoring the current download progress. 66 | @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. 67 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 68 | */ 69 | - (void)loadRequest:(NSURLRequest *)request 70 | MIMEType:(nullable NSString *)MIMEType 71 | textEncodingName:(nullable NSString *)textEncodingName 72 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 73 | success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 74 | failure:(nullable void (^)(NSError *error))failure; 75 | 76 | @end 77 | 78 | NS_ASSUME_NONNULL_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFAutoPurgingImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFAutoPurgingImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.0.4): 3 | - AFNetworking/NSURLSession (= 3.0.4) 4 | - AFNetworking/Reachability (= 3.0.4) 5 | - AFNetworking/Security (= 3.0.4) 6 | - AFNetworking/Serialization (= 3.0.4) 7 | - AFNetworking/UIKit (= 3.0.4) 8 | - AFNetworking/NSURLSession (3.0.4): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.0.4) 13 | - AFNetworking/Security (3.0.4) 14 | - AFNetworking/Serialization (3.0.4) 15 | - AFNetworking/UIKit (3.0.4): 16 | - AFNetworking/NSURLSession 17 | 18 | DEPENDENCIES: 19 | - AFNetworking (~> 3.0) 20 | 21 | SPEC REPOS: 22 | https://github.com/cocoapods/specs.git: 23 | - AFNetworking 24 | 25 | SPEC CHECKSUMS: 26 | AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93 27 | 28 | PODFILE CHECKSUM: 8d0eff399cf1d98e2ff7220113aed7a0d13ff37d 29 | 30 | COCOAPODS: 1.6.0.beta.2 31 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking-c94d3492/AFNetworking-c94d3492-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking_c94d3492 : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking_c94d3492 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking-c94d3492/AFNetworking-c94d3492-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifndef TARGET_OS_IOS 14 | #define TARGET_OS_IOS TARGET_OS_IPHONE 15 | #endif 16 | 17 | #ifndef TARGET_OS_WATCH 18 | #define TARGET_OS_WATCH 0 19 | #endif 20 | 21 | #ifndef TARGET_OS_TV 22 | #define TARGET_OS_TV 0 23 | #endif 24 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking-c94d3492/AFNetworking-c94d3492.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-c94d3492 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking-iOS/AFNetworking-iOS-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking_iOS : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking_iOS 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking-iOS/AFNetworking-iOS-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifndef TARGET_OS_IOS 14 | #define TARGET_OS_IOS TARGET_OS_IPHONE 15 | #endif 16 | 17 | #ifndef TARGET_OS_WATCH 18 | #define TARGET_OS_WATCH 0 19 | #endif 20 | 21 | #ifndef TARGET_OS_TV 22 | #define TARGET_OS_TV 0 23 | #endif 24 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking-iOS/AFNetworking-iOS.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-iOS 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking-tvOS/AFNetworking-tvOS-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking_tvOS : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking_tvOS 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking-tvOS/AFNetworking-tvOS-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifndef TARGET_OS_IOS 14 | #define TARGET_OS_IOS TARGET_OS_IPHONE 15 | #endif 16 | 17 | #ifndef TARGET_OS_WATCH 18 | #define TARGET_OS_WATCH 0 19 | #endif 20 | 21 | #ifndef TARGET_OS_TV 22 | #define TARGET_OS_TV 0 23 | #endif 24 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking-tvOS/AFNetworking-tvOS.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-tvOS 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs Mac Tests/Pods-TestingPods-OHHTTPStubs Mac Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs Mac Tests/Pods-TestingPods-OHHTTPStubs Mac Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | AFNetworking 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs Mac Tests/Pods-TestingPods-OHHTTPStubs Mac Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_TestingPods_OHHTTPStubs_Mac_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_TestingPods_OHHTTPStubs_Mac_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs Mac Tests/Pods-TestingPods-OHHTTPStubs Mac Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs Mac Tests/Pods-TestingPods-OHHTTPStubs Mac Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-c94d3492" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking-c94d3492" -framework "CoreServices" -framework "Security" -framework "SystemConfiguration" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs Mac Tests/Pods-TestingPods-OHHTTPStubs Mac Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-c94d3492" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking-c94d3492" -framework "CoreServices" -framework "Security" -framework "SystemConfiguration" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | AFNetworking 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_TestingPods_OHHTTPStubs_iOS_Fmk_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_TestingPods_OHHTTPStubs_iOS_Fmk_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-iOS" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking-iOS" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-iOS" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking-iOS" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Lib Tests/Pods-TestingPods-OHHTTPStubs iOS Lib Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Lib Tests/Pods-TestingPods-OHHTTPStubs iOS Lib Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | AFNetworking 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Lib Tests/Pods-TestingPods-OHHTTPStubs iOS Lib Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_TestingPods_OHHTTPStubs_iOS_Lib_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_TestingPods_OHHTTPStubs_iOS_Lib_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Lib Tests/Pods-TestingPods-OHHTTPStubs iOS Lib Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Lib Tests/Pods-TestingPods-OHHTTPStubs iOS Lib Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-iOS" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking-iOS" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs iOS Lib Tests/Pods-TestingPods-OHHTTPStubs iOS Lib Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-iOS" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking-iOS" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | AFNetworking 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_TestingPods_OHHTTPStubs_tvOS_Fmk_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_TestingPods_OHHTTPStubs_tvOS_Fmk_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-tvOS" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking-tvOS" -framework "Security" -framework "SystemConfiguration" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking-tvOS" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking-tvOS" -framework "Security" -framework "SystemConfiguration" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Build & test OHHTTPStubs lib from the CLI 2 | 3 | desc 'Build an iOS scheme' 4 | task :ios, [:scheme, :device, :ios_version, :action, :additional_args] do |_,args| 5 | destination = "name=#{args.device},OS=#{args.ios_version}" 6 | build("OHHTTPStubs #{args.scheme}", "iphonesimulator", destination, args.action, args.additional_args) 7 | end 8 | 9 | desc 'Build an OSX scheme' 10 | task :osx, [:scheme, :arch, :action, :additional_args] do |_,args| 11 | destination = "arch=#{args.arch}" 12 | build("OHHTTPStubs #{args.scheme}", "macosx", destination, args.action, args.additional_args) 13 | end 14 | 15 | desc 'Build a tvOS scheme' 16 | task :tvos, [:scheme, :tvos_version, :action, :additional_args] do |_,args| 17 | destination = "name=Apple TV,OS=#{args.tvos_version}" 18 | build("OHHTTPStubs #{args.scheme}", "appletvsimulator", destination, args.action, args.additional_args) 19 | end 20 | 21 | desc 'Test Using Swift Package Manager' 22 | task :spm_test do 23 | sh 'swift test -Xcc -DOHHTTPSTUBS_SKIP_REDIRECT_TESTS' 24 | end 25 | 26 | desc 'List installed simulators' 27 | task :simlist do 28 | sh 'xcrun simctl list' 29 | end 30 | 31 | desc 'Build Example Project' 32 | task :build_example_apps do 33 | build_pod_example("Examples/ObjC") 34 | build_pod_example("Examples/Swift") 35 | build_project("Examples/SwiftPackageManager") 36 | end 37 | 38 | desc 'Build Carthage Frameworks' 39 | task :build_carthage_frameworks, [:platform, :swift_version] do |_,args| 40 | puts "Args were: #{args}" 41 | carthage_build(args.platform, args.swift_version) 42 | end 43 | 44 | # Updates Local Pods, Then Builds 45 | def build_pod_example(dir) 46 | sh "pod install --project-directory=#{dir} --verbose" 47 | build_workspace(dir) 48 | end 49 | 50 | # Builds The Example Workspace 51 | def build_workspace(dir) 52 | sh "xcodebuild -workspace #{dir}/OHHTTPStubsDemo.xcworkspace -scheme OHHTTPStubsDemo build CODE_SIGNING_ALLOWED=NO" 53 | end 54 | 55 | # Builds the Example Project 56 | def build_project(dir) 57 | sh "xcodebuild -project #{dir}/OHHTTPStubsDemo.xcodeproj -scheme OHHTTPStubsDemo build CODE_SIGNING_ALLOWED=NO" 58 | end 59 | 60 | # Builds platform using Carthage 61 | def carthage_build(platform, swift_version) 62 | xcconfig = "/tmp/tmp.xcconfig" 63 | config_contents = "SWIFT_VERSION=#{swift_version}" 64 | sh "echo #{config_contents} > #{xcconfig} && XCODE_XCCONFIG_FILE=#{xcconfig} carthage build --platform #{platform} --no-skip-current" 65 | end 66 | 67 | desc 'Run all travis env tasks locally' 68 | task :travis do 69 | require 'YAML' 70 | travis = YAML.load_file('.travis.yml') 71 | travis['matrix']['include'].each do |matrix| 72 | env = matrix['env'] 73 | arg = env.split('=')[1..-1].join('=') 74 | puts "\n" + ('-'*80) + "\n\n" 75 | sh "rake #{arg}" 76 | end 77 | end 78 | 79 | 80 | # Build the xcodebuild command and run it 81 | def build(scheme, sdk, destination, action, additional_args) 82 | puts <<-ANNOUNCE 83 | ============================= 84 | | Action : #{action} 85 | | SDK : #{sdk} 86 | | Scheme : "#{scheme}" 87 | | Destination: #{destination} 88 | | args : "#{additional_args}" 89 | ============================= 90 | 91 | ANNOUNCE 92 | 93 | cmd = %W( 94 | xcodebuild 95 | -workspace OHHTTPStubs.xcworkspace 96 | -scheme "#{scheme}" 97 | -sdk #{sdk} 98 | -configuration Debug 99 | ONLY_ACTIVE_ARCH=NO 100 | #{additional_args} 101 | -destination '#{destination}' 102 | clean #{action} 103 | ) 104 | 105 | sh "set -o pipefail && #{cmd.join(' ')} | xcpretty -c" 106 | end 107 | -------------------------------------------------------------------------------- /Sources/HTTPMessage/HTTPStubsResponse+HTTPMessage.m: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | #if __has_include() || SWIFT_PACKAGE 26 | #import 27 | 28 | #import "HTTPStubsResponse+HTTPMessage.h" 29 | 30 | @implementation HTTPStubsResponse (HTTPMessage) 31 | 32 | #pragma mark Building response from HTTP Message Data (dump from "curl -is") 33 | 34 | +(instancetype)responseWithHTTPMessageData:(NSData*)responseData; 35 | { 36 | NSData *data = [NSData data]; 37 | NSInteger statusCode = 200; 38 | NSDictionary *headers = @{}; 39 | 40 | CFHTTPMessageRef httpMessage = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, FALSE); 41 | if (httpMessage) 42 | { 43 | CFHTTPMessageAppendBytes(httpMessage, responseData.bytes, responseData.length); 44 | 45 | data = responseData; // By default 46 | 47 | if (CFHTTPMessageIsHeaderComplete(httpMessage)) 48 | { 49 | statusCode = (NSInteger)CFHTTPMessageGetResponseStatusCode(httpMessage); 50 | headers = (__bridge_transfer NSDictionary *)CFHTTPMessageCopyAllHeaderFields(httpMessage); 51 | data = (__bridge_transfer NSData *)CFHTTPMessageCopyBody(httpMessage); 52 | } 53 | CFRelease(httpMessage); 54 | } 55 | 56 | return [self responseWithData:data 57 | statusCode:(int)statusCode 58 | headers:headers]; 59 | } 60 | 61 | +(instancetype)responseNamed:(NSString*)responseName 62 | inBundle:(nullable NSBundle*)responsesBundle 63 | { 64 | NSURL *responseURL = [responsesBundle?:[NSBundle bundleForClass:self.class] URLForResource:responseName 65 | withExtension:@"response"]; 66 | 67 | NSData *responseData = [NSData dataWithContentsOfURL:responseURL]; 68 | NSAssert(responseData, @"Could not find HTTP response named '%@' in bundle '%@'", responseName, responsesBundle); 69 | 70 | return [self responseWithHTTPMessageData:responseData]; 71 | } 72 | 73 | @end 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /Sources/HTTPMessage/include/HTTPStubsResponse+HTTPMessage.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | 26 | /* This category is not available on watchOS because CFNetwork is needed for its implementation but isn't available on Nano */ 27 | #if __has_include() 28 | 29 | #import "HTTPStubsResponse.h" 30 | #import "Compatibility.h" 31 | 32 | NS_ASSUME_NONNULL_BEGIN 33 | 34 | /** 35 | * Adds support for building stubs from "HTTP Messages" conforming to 36 | * the format output by `curl -is` 37 | * 38 | * @note This category is not available on watchOS 39 | */ 40 | @interface HTTPStubsResponse (HTTPMessage) 41 | 42 | /*! @name Building a response from HTTP Message data */ 43 | 44 | // TODO: Try to implement it using NSInputStream someday? 45 | 46 | /** 47 | * Builds a response given a message data as returned by `curl -is [url]`, that is containing both the headers and the body. 48 | * 49 | * This method will split the headers and the body and build a HTTPStubsResponse accordingly 50 | * 51 | * @param responseData The NSData containing the whole HTTP response, including the headers and the body 52 | * 53 | * @return An `HTTPStubsResponse` describing the corresponding response to return by the stub 54 | */ 55 | +(instancetype)responseWithHTTPMessageData:(NSData*)responseData; 56 | 57 | /** 58 | * Builds a response given the name of a `"*.response"` file containing both the headers and the body. 59 | * 60 | * The response file is expected to be in the specified bundle (or the application bundle if nil). 61 | * This method will split the headers and the body and build a HTTPStubsResponse accordingly 62 | * 63 | * @param responseName The name of the `"*.response"` file (without extension) containing the whole 64 | * HTTP response (including the headers and the body) 65 | * @param bundleOrNil The bundle in which the `"*.response"` file is located. If `nil`, the 66 | * `[NSBundle bundleForClass:self.class]` will be used. 67 | * 68 | * @return An `HTTPStubsResponse` describing the corresponding response to return by the stub 69 | */ 70 | 71 | +(instancetype)responseNamed:(NSString*)responseName 72 | inBundle:(nullable NSBundle*)bundleOrNil; 73 | 74 | 75 | @end 76 | 77 | NS_ASSUME_NONNULL_END 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /Sources/OHHTTPStubs/HTTPStubs+NSURLSessionConfiguration.m: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | #import 26 | 27 | #if defined(__IPHONE_7_0) || defined(__MAC_10_9) 28 | #import "HTTPStubs.h" 29 | #import "HTTPStubsMethodSwizzling.h" 30 | 31 | ////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | /** 34 | * This helper is used to swizzle NSURLSessionConfiguration constructor methods 35 | * defaultSessionConfiguration and ephemeralSessionConfiguration to insert the private 36 | * HTTPStubsProtocol into their protocolClasses array so that OHHTTPStubs is automagically 37 | * supported when you create a new NSURLSession based on one of there configurations. 38 | */ 39 | 40 | typedef NSURLSessionConfiguration*(*SessionConfigConstructor)(id,SEL); 41 | static SessionConfigConstructor orig_defaultSessionConfiguration; 42 | static SessionConfigConstructor orig_ephemeralSessionConfiguration; 43 | 44 | static NSURLSessionConfiguration* HTTPStubs_defaultSessionConfiguration(id self, SEL _cmd) 45 | { 46 | NSURLSessionConfiguration* config = orig_defaultSessionConfiguration(self,_cmd); // call original method 47 | [HTTPStubs setEnabled:YES forSessionConfiguration:config]; //OHHTTPStubsAddProtocolClassToNSURLSessionConfiguration(config); 48 | return config; 49 | } 50 | 51 | static NSURLSessionConfiguration* HTTPStubs_ephemeralSessionConfiguration(id self, SEL _cmd) 52 | { 53 | NSURLSessionConfiguration* config = orig_ephemeralSessionConfiguration(self,_cmd); // call original method 54 | [HTTPStubs setEnabled:YES forSessionConfiguration:config]; //OHHTTPStubsAddProtocolClassToNSURLSessionConfiguration(config); 55 | return config; 56 | } 57 | 58 | @interface NSURLSessionConfiguration(HTTPStubsSupport) @end 59 | 60 | @implementation NSURLSessionConfiguration(HTTPStubsSupport) 61 | 62 | +(void)load 63 | { 64 | orig_defaultSessionConfiguration = (SessionConfigConstructor)HTTPStubsReplaceMethod(@selector(defaultSessionConfiguration), 65 | (IMP)HTTPStubs_defaultSessionConfiguration, 66 | [NSURLSessionConfiguration class], 67 | YES); 68 | orig_ephemeralSessionConfiguration = (SessionConfigConstructor)HTTPStubsReplaceMethod(@selector(ephemeralSessionConfiguration), 69 | (IMP)HTTPStubs_ephemeralSessionConfiguration, 70 | [NSURLSessionConfiguration class], 71 | YES); 72 | } 73 | 74 | @end 75 | 76 | #endif /* __IPHONE_7_0 || __MAC_10_9 */ 77 | 78 | 79 | -------------------------------------------------------------------------------- /Sources/OHHTTPStubs/HTTPStubsMethodSwizzling.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon, 2016 Sebastian Hagedorn 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | //////////////////////////////////////////////////////////////////////////////// 26 | #pragma mark - Imports 27 | 28 | #import 29 | 30 | //////////////////////////////////////////////////////////////////////////////// 31 | #pragma mark - Method Swizzling Helpers 32 | 33 | /** 34 | * Replaces the selector's associated method implementation with the 35 | * given implementation (or adds it, if there was no existing one). 36 | * 37 | * @param selector The selector entry in the dispatch table. 38 | * @param newImpl The implementation that will be associated with 39 | * the given selector. 40 | * @param affectedClass The class whose dispatch table will be altered. 41 | * @param isClassMethod Set to YES if the selector denotes a class 42 | * method, or NO if it is an instance method. 43 | * @return The previous implementation associated with 44 | * the swizzled selector. You should store the 45 | * implementation and call it when overwriting 46 | * the selector. 47 | */ 48 | __attribute__((warn_unused_result)) IMP HTTPStubsReplaceMethod(SEL selector, 49 | IMP newImpl, 50 | Class affectedClass, 51 | BOOL isClassMethod); 52 | -------------------------------------------------------------------------------- /Sources/OHHTTPStubs/HTTPStubsMethodSwizzling.m: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon, 2016 Sebastian Hagedorn 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | //////////////////////////////////////////////////////////////////////////////// 26 | #pragma mark - Imports 27 | 28 | #import "HTTPStubsMethodSwizzling.h" 29 | 30 | ////////////////////////////////////////////////////////////////////////////////////////////////// 31 | #pragma mark - Method Swizzling Helpers 32 | 33 | IMP HTTPStubsReplaceMethod(SEL selector, 34 | IMP newImpl, 35 | Class affectedClass, 36 | BOOL isClassMethod) 37 | { 38 | Method origMethod = isClassMethod ? class_getClassMethod(affectedClass, selector) : class_getInstanceMethod(affectedClass, selector); 39 | IMP origImpl = method_getImplementation(origMethod); 40 | 41 | if (!class_addMethod(isClassMethod ? object_getClass(affectedClass) : affectedClass, selector, newImpl, method_getTypeEncoding(origMethod))) 42 | { 43 | method_setImplementation(origMethod, newImpl); 44 | } 45 | 46 | return origImpl; 47 | } 48 | -------------------------------------------------------------------------------- /Sources/OHHTTPStubs/HTTPStubsPathHelpers.m: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | 26 | #import "HTTPStubsPathHelpers.h" 27 | 28 | NSString* __nullable OHPathForFile(NSString* fileName, Class inBundleForClass) 29 | { 30 | NSBundle* bundle = [NSBundle bundleForClass:inBundleForClass]; 31 | return OHPathForFileInBundle(fileName, bundle); 32 | } 33 | 34 | NSString* __nullable OHPathForFileInBundle(NSString* fileName, NSBundle* bundle) 35 | { 36 | return [bundle pathForResource:[fileName stringByDeletingPathExtension] 37 | ofType:[fileName pathExtension]]; 38 | } 39 | 40 | NSString* __nullable OHPathForFileInDocumentsDir(NSString* fileName) 41 | { 42 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 43 | NSString *basePath = (paths.count > 0) ? paths[0] : nil; 44 | return [basePath stringByAppendingPathComponent:fileName]; 45 | } 46 | 47 | NSBundle* __nullable OHResourceBundle(NSString* bundleBasename, Class inBundleForClass) 48 | { 49 | NSBundle* classBundle = [NSBundle bundleForClass:inBundleForClass]; 50 | return [NSBundle bundleWithPath:[classBundle pathForResource:bundleBasename 51 | ofType:@"bundle"]]; 52 | } 53 | -------------------------------------------------------------------------------- /Sources/OHHTTPStubs/HTTPStubsResponse+JSON.m: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | 26 | #import "HTTPStubsResponse+JSON.h" 27 | 28 | @implementation HTTPStubsResponse (JSON) 29 | 30 | /*! @name Building a response from JSON objects */ 31 | 32 | + (instancetype)responseWithJSONObject:(id)jsonObject 33 | statusCode:(int)statusCode 34 | headers:(nullable NSDictionary *)httpHeaders 35 | { 36 | if (!httpHeaders[@"Content-Type"]) 37 | { 38 | NSMutableDictionary* mutableHeaders = [NSMutableDictionary dictionaryWithDictionary:httpHeaders]; 39 | mutableHeaders[@"Content-Type"] = @"application/json"; 40 | httpHeaders = [NSDictionary dictionaryWithDictionary:mutableHeaders]; // make immutable again 41 | } 42 | 43 | return [self responseWithData:[NSJSONSerialization dataWithJSONObject:jsonObject options:0 error:nil] 44 | statusCode:statusCode 45 | headers:httpHeaders]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Sources/OHHTTPStubs/NSURLRequest+HTTPBodyTesting.m: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2016 Sebastian Hagedorn, Felix Lamouroux 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | #import "NSURLRequest+HTTPBodyTesting.h" 26 | 27 | #if defined(__IPHONE_7_0) || defined(__MAC_10_9) 28 | 29 | //////////////////////////////////////////////////////////////////////////////// 30 | #pragma mark - Imports 31 | 32 | #import "HTTPStubsMethodSwizzling.h" 33 | 34 | //////////////////////////////////////////////////////////////////////////////// 35 | #pragma mark - NSURLRequest+CustomHTTPBody 36 | 37 | NSString * const OHHTTPStubs_HTTPBodyKey = @"HTTPBody"; 38 | 39 | @implementation NSURLRequest (HTTPBodyTesting) 40 | 41 | - (NSData*)OHHTTPStubs_HTTPBody 42 | { 43 | return [NSURLProtocol propertyForKey:OHHTTPStubs_HTTPBodyKey inRequest:self]; 44 | } 45 | 46 | @end 47 | 48 | //////////////////////////////////////////////////////////////////////////////// 49 | #pragma mark - NSMutableURLRequest+HTTPBodyTesting 50 | 51 | typedef void(*HTTPStubsSetterIMP)(id, SEL, id); 52 | static HTTPStubsSetterIMP orig_setHTTPBody; 53 | 54 | static void OHHTTPStubs_setHTTPBody(id self, SEL _cmd, NSData* HTTPBody) 55 | { 56 | // store the http body via NSURLProtocol 57 | if (HTTPBody) { 58 | [NSURLProtocol setProperty:HTTPBody forKey:OHHTTPStubs_HTTPBodyKey inRequest:self]; 59 | } else { 60 | // unfortunately resetting does not work properly as the NSURLSession also uses this to reset the property 61 | } 62 | 63 | orig_setHTTPBody(self, _cmd, HTTPBody); 64 | } 65 | 66 | /** 67 | * Swizzles setHTTPBody: in order to maintain a copy of the http body for later 68 | * reference and calls the original implementation. 69 | * 70 | * @warning Should not be used in production, testing only. 71 | */ 72 | @interface NSMutableURLRequest (HTTPBodyTesting) @end 73 | 74 | @implementation NSMutableURLRequest (HTTPBodyTesting) 75 | 76 | + (void)load 77 | { 78 | orig_setHTTPBody = (HTTPStubsSetterIMP)HTTPStubsReplaceMethod(@selector(setHTTPBody:), 79 | (IMP)OHHTTPStubs_setHTTPBody, 80 | [NSMutableURLRequest class], 81 | NO); 82 | } 83 | 84 | @end 85 | 86 | #endif /* __IPHONE_7_0 || __MAC_10_9 */ 87 | -------------------------------------------------------------------------------- /Sources/OHHTTPStubs/include/Compatibility.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | 26 | /* 27 | * This file allows to keep compatibility with older SDKs which didn't have 28 | * the latest features and associated macros yet. 29 | */ 30 | 31 | 32 | #ifndef NS_DESIGNATED_INITIALIZER 33 | #if __has_attribute(objc_designated_initializer) 34 | #define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 35 | #else 36 | #define NS_DESIGNATED_INITIALIZER 37 | #endif 38 | #endif 39 | 40 | // Allow to use nullability macros and keywords even if not supported yet 41 | #if ! __has_feature(nullability) 42 | #define NS_ASSUME_NONNULL_BEGIN 43 | #define NS_ASSUME_NONNULL_END 44 | #define nullable 45 | #define __nullable 46 | #define __nonnull 47 | #endif 48 | -------------------------------------------------------------------------------- /Sources/OHHTTPStubs/include/HTTPStubsPathHelpers.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | 26 | #import 27 | 28 | #import "Compatibility.h" 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | /** 33 | * Useful function to build a path given a file name and a class. 34 | * 35 | * @param fileName The name of the file to get the path to, including file extension 36 | * @param inBundleForClass The class of the caller, used to determine the current bundle 37 | * in which the file is supposed to be located. 38 | * You should typically pass `self.class` (ObjC) or 39 | * `self.dynamicType` (Swift < 3.0) or `type(of: self)` (Swift >= 3.0) when calling this function. 40 | * 41 | * @return The path of the given file in the same bundle as the inBundleForClass class 42 | */ 43 | NSString* __nullable OHPathForFile(NSString* fileName, Class inBundleForClass); 44 | 45 | /** 46 | * Useful function to build a path given a file name and a bundle. 47 | * 48 | * @param fileName The name of the file to get the path to, including file extension 49 | * @param bundle The bundle in which the file is supposed to be located. 50 | * This parameter can't be null. 51 | * 52 | * @return The path of the given file in given bundle 53 | * 54 | * @note You should avoid using `[NSBundle mainBundle]` for the `bundle` parameter, 55 | * as in the context of Unit Tests, this points to the Simulator's bundle, 56 | * not the bundle of the app under test. That's why `nil` is not an acceptable 57 | * value (so you won't expect it to default to the `mainBundle`). 58 | * You should use `[NSBundle bundleForClass:]` instead. 59 | */ 60 | NSString* __nullable OHPathForFileInBundle(NSString* fileName, NSBundle* bundle); 61 | 62 | /** 63 | * Useful function to build a path to a file in the Documents's directory in the 64 | * app sandbox, used by iTunes File Sharing for example. 65 | * 66 | * @param fileName The name of the file to get the path to, including file extension 67 | * 68 | * @return The path of the file in the Documents directory in your App Sandbox 69 | */ 70 | NSString* __nullable OHPathForFileInDocumentsDir(NSString* fileName); 71 | 72 | 73 | 74 | /** 75 | * Useful function to build an NSBundle located in the application's resources simply from its name 76 | * 77 | * @param bundleBasename The base name, without extension (extension is assumed to be ".bundle"). 78 | * @param inBundleForClass The class of the caller, used to determine the current bundle 79 | * in which the file is supposed to be located. 80 | * You should typically pass `self.class` (ObjC) or 81 | * `self.dynamicType` (Swift) when calling this function. 82 | * 83 | * @return The NSBundle object representing the bundle with the given basename located in your application's resources. 84 | */ 85 | NSBundle* __nullable OHResourceBundle(NSString* bundleBasename, Class inBundleForClass); 86 | 87 | NS_ASSUME_NONNULL_END 88 | -------------------------------------------------------------------------------- /Sources/OHHTTPStubs/include/HTTPStubsResponse+JSON.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | 26 | #import "HTTPStubsResponse.h" 27 | #import "Compatibility.h" 28 | 29 | NS_ASSUME_NONNULL_BEGIN 30 | 31 | /** 32 | * Adds convenience methods to manipulate JSON objects directly. 33 | * Pass in an `NSDictionary` or `NSArray` to generate a corresponding JSON output. 34 | */ 35 | @interface HTTPStubsResponse (JSON) 36 | 37 | /** 38 | * Builds a response given a JSON object for the response body, status code, and headers. 39 | * 40 | * @param jsonObject Object representing the response body. 41 | * Typically a `NSDictionary`; may be any object accepted by `+[NSJSONSerialization dataWithJSONObject:options:error:]` 42 | * @param statusCode The HTTP Status Code to use in the response 43 | * @param httpHeaders The HTTP Headers to return in the response 44 | * If a "Content-Type" header is not included, "Content-Type: application/json" will be added. 45 | * 46 | * @return An `HTTPStubsResponse` describing the corresponding response to return by the stub 47 | * 48 | * @note This method typically calls `responseWithData:statusCode:headers:`, passing the serialized JSON 49 | * object as the data parameter and adding the Content-Type header if necessary. 50 | */ 51 | + (instancetype)responseWithJSONObject:(id)jsonObject 52 | statusCode:(int)statusCode 53 | headers:(nullable NSDictionary *)httpHeaders; 54 | 55 | @end 56 | 57 | NS_ASSUME_NONNULL_END 58 | -------------------------------------------------------------------------------- /Sources/OHHTTPStubs/include/NSURLRequest+HTTPBodyTesting.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2016 Sebastian Hagedorn, Felix Lamouroux 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | //////////////////////////////////////////////////////////////////////////////// 26 | #pragma mark - Imports 27 | 28 | #import 29 | 30 | // This category is only useful when NSURLSession is present 31 | #if defined(__IPHONE_7_0) || defined(__MAC_10_9) 32 | 33 | //////////////////////////////////////////////////////////////////////////////// 34 | #pragma mark - NSURLRequest+HTTPBodyTesting 35 | 36 | @interface NSURLRequest (HTTPBodyTesting) 37 | /** 38 | * Unfortunately, when sending POST requests (with a body) using NSURLSession, 39 | * by the time the request arrives at OHHTTPStubs, the HTTPBody of the 40 | * NSURLRequest has been reset to nil. 41 | * 42 | * You can use this method to retrieve the HTTPBody for testing and use it to 43 | * conditionally stub your requests. 44 | */ 45 | - (NSData *)OHHTTPStubs_HTTPBody; 46 | @end 47 | 48 | #endif /* __IPHONE_7_0 || __MAC_10_9 */ 49 | -------------------------------------------------------------------------------- /Sources/Supporting Files/OHHTTPStubs Mac-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2014 AliSoftware. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Sources/Supporting Files/OHHTTPStubs iOS-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2014 AliSoftware. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Sources/Supporting Files/OHHTTPStubs.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************** 2 | * 3 | * Copyright (c) 2012 Olivier Halligon 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in 13 | * all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | * THE SOFTWARE. 22 | * 23 | ***********************************************************************************/ 24 | 25 | #import "Compatibility.h" 26 | #import "NSURLRequest+HTTPBodyTesting.h" 27 | #import "HTTPStubs.h" 28 | #import "HTTPStubsResponse.h" 29 | #import "HTTPStubsResponse+JSON.h" 30 | #import "HTTPStubsResponse+HTTPMessage.h" 31 | #import "HTTPStubs+Mocktail.h" 32 | #import "HTTPStubsPathHelpers.h" 33 | 34 | -------------------------------------------------------------------------------- /Tests/Fixtures/MocktailFolder/cards.tail: -------------------------------------------------------------------------------- 1 | GET 2 | .*/cards 3 | 200 4 | application/json 5 | 6 | [ 7 | { 8 | "gift_card_id": "91857d87-481a-490b-8aff-c72614094398", 9 | "card_number": "515676xxxxxx1234", 10 | "amount": "$25.28", 11 | "expiration_date": "2014-04" 12 | }, 13 | { 14 | "gift_card_id": "0578ebe0-015b-11e4-9191-0800200c9a66", 15 | "card_number": "515676xxxxxx2345", 16 | "amount": "$55.38", 17 | "expiration_date": "2014-05" 18 | } 19 | ] -------------------------------------------------------------------------------- /Tests/Fixtures/MocktailFolder/login.tail: -------------------------------------------------------------------------------- 1 | GET|POST 2 | .*/users 3 | 200 4 | application/json 5 | 6 | 7 | { 8 | "user_id": "happyuser1", 9 | "user_token": "happytoken", 10 | "status": "SUCCESS" 11 | } -------------------------------------------------------------------------------- /Tests/Fixtures/empty.bundle/nothingtoseehere.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AliSoftware/OHHTTPStubs/c582400a38590a3dabb4353416d9d46cb7278d06/Tests/Fixtures/empty.bundle/nothingtoseehere.json -------------------------------------------------------------------------------- /Tests/Fixtures/emptyfile.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AliSoftware/OHHTTPStubs/c582400a38590a3dabb4353416d9d46cb7278d06/Tests/Fixtures/emptyfile.json -------------------------------------------------------------------------------- /Tests/Fixtures/login.tail: -------------------------------------------------------------------------------- 1 | GET|POST 2 | .*/users 3 | 200 4 | application/json 5 | 6 | { 7 | "user_id": "happyuser1", 8 | "user_token": "happytoken", 9 | "status": "SUCCESS" 10 | } -------------------------------------------------------------------------------- /Tests/Fixtures/login_content_type.tail: -------------------------------------------------------------------------------- 1 | GET|POST 2 | .*/users 3 | 200 4 | application/json 5 | 6 | { 7 | "user_id": "happyuser1", 8 | "user_token": "happytoken", 9 | "status": "SUCCESS" 10 | } -------------------------------------------------------------------------------- /Tests/Fixtures/login_content_type_and_headers.tail: -------------------------------------------------------------------------------- 1 | GET|POST 2 | .*/users 3 | 200 4 | application/json 5 | Connection: Close 6 | 7 | { 8 | "user_id": "happyuser1", 9 | "user_token": "happytoken", 10 | "status": "SUCCESS" 11 | } -------------------------------------------------------------------------------- /Tests/Fixtures/login_headers.tail: -------------------------------------------------------------------------------- 1 | GET|POST 2 | .*/users 3 | 200 4 | Content-Type: application/json 5 | Connection: Close 6 | 7 | { 8 | "user_id": "happyuser1", 9 | "user_token": "happytoken", 10 | "status": "SUCCESS" 11 | } -------------------------------------------------------------------------------- /Tests/OHHTTPStubsTests/OHPathHelpersTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #if OHHTTPSTUBS_USE_STATIC_LIBRARY || SWIFT_PACKAGE 4 | #import "HTTPStubs.h" 5 | #import "HTTPStubsPathHelpers.h" 6 | #else 7 | @import OHHTTPStubs; 8 | #endif 9 | 10 | @interface HTTPStubsPathHelpersTests : XCTestCase 11 | @end 12 | 13 | @implementation HTTPStubsPathHelpersTests 14 | 15 | - (void)testOHResourceBundle { 16 | NSBundle *classBundle = [NSBundle bundleForClass:self.class]; 17 | NSBundle *expectedBundle = [NSBundle bundleWithPath:[classBundle pathForResource:@"empty" 18 | ofType:@"bundle"]]; 19 | 20 | XCTAssertEqual(OHResourceBundle(@"empty", self.class), expectedBundle); 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Tests/Supporting Files/UnitTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/Supporting Files/UnitTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OHHTTPStubs Unit Tests' target in the 'OHHTTPStubs Unit Tests' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | --------------------------------------------------------------------------------