├── .gitignore ├── .travis.yml ├── Gemfile ├── Images └── watchcon.png ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── Expecta │ ├── Expecta │ │ ├── EXPBlockDefinedMatcher.h │ │ ├── EXPBlockDefinedMatcher.m │ │ ├── EXPDefines.h │ │ ├── EXPDoubleTuple.h │ │ ├── EXPDoubleTuple.m │ │ ├── EXPExpect.h │ │ ├── EXPExpect.m │ │ ├── EXPFloatTuple.h │ │ ├── EXPFloatTuple.m │ │ ├── EXPMatcher.h │ │ ├── EXPUnsupportedObject.h │ │ ├── EXPUnsupportedObject.m │ │ ├── Expecta.h │ │ ├── ExpectaObject.h │ │ ├── ExpectaObject.m │ │ ├── ExpectaSupport.h │ │ ├── ExpectaSupport.m │ │ ├── Matchers │ │ │ ├── EXPMatcherHelpers.h │ │ │ ├── EXPMatcherHelpers.m │ │ │ ├── EXPMatchers+beCloseTo.h │ │ │ ├── EXPMatchers+beCloseTo.m │ │ │ ├── EXPMatchers+beFalsy.h │ │ │ ├── EXPMatchers+beFalsy.m │ │ │ ├── EXPMatchers+beGreaterThan.h │ │ │ ├── EXPMatchers+beGreaterThan.m │ │ │ ├── EXPMatchers+beGreaterThanOrEqualTo.h │ │ │ ├── EXPMatchers+beGreaterThanOrEqualTo.m │ │ │ ├── EXPMatchers+beIdenticalTo.h │ │ │ ├── EXPMatchers+beIdenticalTo.m │ │ │ ├── EXPMatchers+beInTheRangeOf.h │ │ │ ├── EXPMatchers+beInTheRangeOf.m │ │ │ ├── EXPMatchers+beInstanceOf.h │ │ │ ├── EXPMatchers+beInstanceOf.m │ │ │ ├── EXPMatchers+beKindOf.h │ │ │ ├── EXPMatchers+beKindOf.m │ │ │ ├── EXPMatchers+beLessThan.h │ │ │ ├── EXPMatchers+beLessThan.m │ │ │ ├── EXPMatchers+beLessThanOrEqualTo.h │ │ │ ├── EXPMatchers+beLessThanOrEqualTo.m │ │ │ ├── EXPMatchers+beNil.h │ │ │ ├── EXPMatchers+beNil.m │ │ │ ├── EXPMatchers+beSubclassOf.h │ │ │ ├── EXPMatchers+beSubclassOf.m │ │ │ ├── EXPMatchers+beSupersetOf.h │ │ │ ├── EXPMatchers+beSupersetOf.m │ │ │ ├── EXPMatchers+beTruthy.h │ │ │ ├── EXPMatchers+beTruthy.m │ │ │ ├── EXPMatchers+beginWith.h │ │ │ ├── EXPMatchers+beginWith.m │ │ │ ├── EXPMatchers+conformTo.h │ │ │ ├── EXPMatchers+conformTo.m │ │ │ ├── EXPMatchers+contain.h │ │ │ ├── EXPMatchers+contain.m │ │ │ ├── EXPMatchers+endWith.h │ │ │ ├── EXPMatchers+endWith.m │ │ │ ├── EXPMatchers+equal.h │ │ │ ├── EXPMatchers+equal.m │ │ │ ├── EXPMatchers+haveCountOf.h │ │ │ ├── EXPMatchers+haveCountOf.m │ │ │ ├── EXPMatchers+match.h │ │ │ ├── EXPMatchers+match.m │ │ │ ├── EXPMatchers+postNotification.h │ │ │ ├── EXPMatchers+postNotification.m │ │ │ ├── EXPMatchers+raise.h │ │ │ ├── EXPMatchers+raise.m │ │ │ ├── EXPMatchers+raiseWithReason.h │ │ │ ├── EXPMatchers+raiseWithReason.m │ │ │ ├── EXPMatchers+respondTo.h │ │ │ ├── EXPMatchers+respondTo.m │ │ │ └── EXPMatchers.h │ │ ├── NSObject+Expecta.h │ │ ├── NSValue+Expecta.h │ │ └── NSValue+Expecta.m │ ├── LICENSE │ └── README.md ├── Local Podspecs │ └── WatchCon.podspec.json ├── Manifest.lock ├── OCMock │ ├── License.txt │ ├── README.md │ └── Source │ │ └── OCMock │ │ ├── NSInvocation+OCMAdditions.h │ │ ├── NSInvocation+OCMAdditions.m │ │ ├── NSMethodSignature+OCMAdditions.h │ │ ├── NSMethodSignature+OCMAdditions.m │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ ├── NSNotificationCenter+OCMAdditions.m │ │ ├── NSObject+OCMAdditions.h │ │ ├── NSObject+OCMAdditions.m │ │ ├── NSValue+OCMAdditions.h │ │ ├── NSValue+OCMAdditions.m │ │ ├── OCClassMockObject.h │ │ ├── OCClassMockObject.m │ │ ├── OCMArg.h │ │ ├── OCMArg.m │ │ ├── OCMArgAction.h │ │ ├── OCMArgAction.m │ │ ├── OCMBlockArgCaller.h │ │ ├── OCMBlockArgCaller.m │ │ ├── OCMBlockCaller.h │ │ ├── OCMBlockCaller.m │ │ ├── OCMBoxedReturnValueProvider.h │ │ ├── OCMBoxedReturnValueProvider.m │ │ ├── OCMConstraint.h │ │ ├── OCMConstraint.m │ │ ├── OCMExceptionReturnValueProvider.h │ │ ├── OCMExceptionReturnValueProvider.m │ │ ├── OCMExpectationRecorder.h │ │ ├── OCMExpectationRecorder.m │ │ ├── OCMFunctions.h │ │ ├── OCMFunctions.m │ │ ├── OCMFunctionsPrivate.h │ │ ├── OCMIndirectReturnValueProvider.h │ │ ├── OCMIndirectReturnValueProvider.m │ │ ├── OCMInvocationExpectation.h │ │ ├── OCMInvocationExpectation.m │ │ ├── OCMInvocationMatcher.h │ │ ├── OCMInvocationMatcher.m │ │ ├── OCMInvocationStub.h │ │ ├── OCMInvocationStub.m │ │ ├── OCMLocation.h │ │ ├── OCMLocation.m │ │ ├── OCMMacroState.h │ │ ├── OCMMacroState.m │ │ ├── OCMNotificationPoster.h │ │ ├── OCMNotificationPoster.m │ │ ├── OCMObserverRecorder.h │ │ ├── OCMObserverRecorder.m │ │ ├── OCMPassByRefSetter.h │ │ ├── OCMPassByRefSetter.m │ │ ├── OCMRealObjectForwarder.h │ │ ├── OCMRealObjectForwarder.m │ │ ├── OCMRecorder.h │ │ ├── OCMRecorder.m │ │ ├── OCMReturnValueProvider.h │ │ ├── OCMReturnValueProvider.m │ │ ├── OCMStubRecorder.h │ │ ├── OCMStubRecorder.m │ │ ├── OCMVerifier.h │ │ ├── OCMVerifier.m │ │ ├── OCMock.h │ │ ├── OCMockObject.h │ │ ├── OCMockObject.m │ │ ├── OCObserverMockObject.h │ │ ├── OCObserverMockObject.m │ │ ├── OCPartialMockObject.h │ │ ├── OCPartialMockObject.m │ │ ├── OCProtocolMockObject.h │ │ └── OCProtocolMockObject.m ├── Pods.xcodeproj │ └── project.pbxproj ├── Quick │ ├── LICENSE │ ├── README.md │ └── Sources │ │ ├── Quick │ │ ├── Behavior.swift │ │ ├── Callsite.swift │ │ ├── Configuration │ │ │ └── Configuration.swift │ │ ├── DSL │ │ │ ├── DSL.swift │ │ │ └── World+DSL.swift │ │ ├── ErrorUtility.swift │ │ ├── Example.swift │ │ ├── ExampleGroup.swift │ │ ├── ExampleMetadata.swift │ │ ├── Filter.swift │ │ ├── Hooks │ │ │ ├── Closures.swift │ │ │ ├── ExampleHooks.swift │ │ │ ├── HooksPhase.swift │ │ │ └── SuiteHooks.swift │ │ ├── NSBundle+CurrentTestBundle.swift │ │ ├── NSString+C99ExtendedIdentifier.swift │ │ ├── QuickSelectedTestSuiteBuilder.swift │ │ ├── QuickTestSuite.swift │ │ ├── URL+FileName.swift │ │ └── World.swift │ │ ├── QuickObjectiveC │ │ ├── Configuration │ │ │ ├── QuickConfiguration.h │ │ │ └── QuickConfiguration.m │ │ ├── DSL │ │ │ ├── QCKDSL.h │ │ │ ├── QCKDSL.m │ │ │ └── World+DSL.h │ │ ├── Quick.h │ │ ├── QuickSpec.h │ │ ├── QuickSpec.m │ │ ├── World.h │ │ └── XCTestSuite+QuickTestSuiteBuilder.m │ │ └── QuickSpecBase │ │ ├── QuickSpecBase.m │ │ └── include │ │ └── QuickSpecBase.h └── Target Support Files │ ├── Expecta │ ├── Expecta-dummy.m │ ├── Expecta-prefix.pch │ ├── Expecta-umbrella.h │ ├── Expecta.modulemap │ ├── Expecta.xcconfig │ └── Info.plist │ ├── OCMock │ ├── Info.plist │ ├── OCMock-dummy.m │ ├── OCMock-prefix.pch │ ├── OCMock-umbrella.h │ ├── OCMock.modulemap │ └── OCMock.xcconfig │ ├── Pods-WatchCon-iOS │ ├── Info.plist │ ├── Pods-WatchCon-iOS-acknowledgements.markdown │ ├── Pods-WatchCon-iOS-acknowledgements.plist │ ├── Pods-WatchCon-iOS-dummy.m │ ├── Pods-WatchCon-iOS-resources.sh │ ├── Pods-WatchCon-iOS-umbrella.h │ ├── Pods-WatchCon-iOS.debug.xcconfig │ ├── Pods-WatchCon-iOS.modulemap │ └── Pods-WatchCon-iOS.release.xcconfig │ ├── Pods-WatchCon-iOSTests │ ├── Info.plist │ ├── Pods-WatchCon-iOSTests-acknowledgements.markdown │ ├── Pods-WatchCon-iOSTests-acknowledgements.plist │ ├── Pods-WatchCon-iOSTests-dummy.m │ ├── Pods-WatchCon-iOSTests-frameworks.sh │ ├── Pods-WatchCon-iOSTests-resources.sh │ ├── Pods-WatchCon-iOSTests-umbrella.h │ ├── Pods-WatchCon-iOSTests.debug.xcconfig │ ├── Pods-WatchCon-iOSTests.modulemap │ └── Pods-WatchCon-iOSTests.release.xcconfig │ └── Quick │ ├── Info.plist │ ├── Quick-dummy.m │ ├── Quick-prefix.pch │ ├── Quick-umbrella.h │ ├── Quick.modulemap │ └── Quick.xcconfig ├── README.md ├── Sample └── WatchOS-Sample │ ├── WatchOS-Sample WatchKit App │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ └── Interface.storyboard │ └── Info.plist │ ├── WatchOS-Sample WatchKit Extension │ ├── Assets.xcassets │ │ └── Complication.complicationset │ │ │ ├── Circular.imageset │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── Extra Large.imageset │ │ │ └── Contents.json │ │ │ ├── Modular.imageset │ │ │ └── Contents.json │ │ │ └── Utilitarian.imageset │ │ │ └── Contents.json │ ├── ExtensionDelegate.h │ ├── ExtensionDelegate.m │ ├── Info.plist │ ├── InterfaceController.h │ ├── InterfaceController.m │ ├── NotificationController.h │ ├── NotificationController.m │ └── PushNotificationPayload.apns │ ├── WatchOS-Sample.xcodeproj │ └── project.pbxproj │ └── WatchOS-Sample │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── Sources ├── Info-iOS.plist ├── Info-watchOS.plist ├── WatchCon.h ├── WatchConSession.h └── WatchConSession.m ├── Tests ├── Info.plist └── WatchConSessionTests.m ├── WatchCon.podspec ├── WatchCon.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── WatchCon-iOS.xcscheme │ └── WatchCon-watchOS.xcscheme └── WatchCon.xcworkspace └── contents.xcworkspacedata /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode9 3 | 4 | env: 5 | global: 6 | - LC_CTYPE=en_US.UTF-8 7 | - LANG=en_US.UTF-8 8 | - WORKSPACE=WatchCon.xcworkspace 9 | - IOS_FRAMEWORK_SCHEME="WatchCon-iOS" 10 | - WATCHOS_FRAMEWORK_SCHEME="WatchCon-watchOS" 11 | - IOS_SDK=iphonesimulator11.0 12 | - WATCHOS_SDK=watchsimulator4.0 13 | matrix: 14 | - DESTINATION="OS=11.0,name=iPhone SE" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="NO" POD_LINT="NO" 15 | - DESTINATION="OS=4.0,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" 16 | 17 | branches: 18 | only: 19 | - master 20 | 21 | before_install: 22 | - rm -rf /Users/travis/Library/Developer/Xcode/DerivedData/WatchCon-*/ 23 | - rvm use $RVM_RUBY_VERSION 24 | 25 | install: 26 | - bundle install 27 | 28 | script: 29 | - set -o pipefail 30 | - xcodebuild -version 31 | - xcodebuild -showsdks 32 | 33 | # Build Framework in Debug and Run Tests if specified 34 | - if [ $RUN_TESTS == "YES" ]; then 35 | travis_retry xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty; 36 | else 37 | xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty; 38 | fi 39 | 40 | # Build Framework in Release 41 | - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty; 42 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'xcpretty' 4 | -------------------------------------------------------------------------------- /Images/watchcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdullahselek/WatchCon/bcef1faeae54a3428aaa18ea667ce470b2acbf49/Images/watchcon.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Abdullah Selek 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 all 13 | 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 THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | 3 | workspace 'WatchCon.xcworkspace' 4 | 5 | target 'WatchCon-iOS' do 6 | project 'WatchCon.xcodeproj' 7 | use_frameworks! 8 | 9 | target 'WatchCon-iOSTests' do 10 | inherit! :search_paths 11 | pod 'OCMock' 12 | pod 'Quick' 13 | pod 'Expecta' 14 | end 15 | 16 | end 17 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Expecta (1.0.6) 3 | - OCMock (3.4.1) 4 | - Quick (1.2.0) 5 | 6 | DEPENDENCIES: 7 | - Expecta 8 | - OCMock 9 | - Quick 10 | 11 | SPEC CHECKSUMS: 12 | Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5 13 | OCMock: 2cd0716969bab32a2283ff3a46fd26a8c8b4c5e3 14 | Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08 15 | 16 | PODFILE CHECKSUM: f0a029b181f562682d167c657b569a4bc2630c95 17 | 18 | COCOAPODS: 1.2.1 19 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/EXPBlockDefinedMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // EXPRuntimeMatcher.h 3 | // Expecta 4 | // 5 | // Created by Luke Redpath on 26/03/2012. 6 | // Copyright (c) 2012 Peter Jihoon Kim. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "EXPMatcher.h" 11 | #import "EXPDefines.h" 12 | 13 | @interface EXPBlockDefinedMatcher : NSObject { 14 | EXPBoolBlock prerequisiteBlock; 15 | EXPBoolBlock matchBlock; 16 | EXPStringBlock failureMessageForToBlock; 17 | EXPStringBlock failureMessageForNotToBlock; 18 | } 19 | 20 | @property(nonatomic, copy) EXPBoolBlock prerequisiteBlock; 21 | @property(nonatomic, copy) EXPBoolBlock matchBlock; 22 | @property(nonatomic, copy) EXPStringBlock failureMessageForToBlock; 23 | @property(nonatomic, copy) EXPStringBlock failureMessageForNotToBlock; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/EXPBlockDefinedMatcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // EXPRuntimeMatcher.m 3 | // Expecta 4 | // 5 | // Created by Luke Redpath on 26/03/2012. 6 | // Copyright (c) 2012 Peter Jihoon Kim. All rights reserved. 7 | // 8 | 9 | #import "EXPBlockDefinedMatcher.h" 10 | 11 | @implementation EXPBlockDefinedMatcher 12 | 13 | - (void)dealloc 14 | { 15 | self.prerequisiteBlock = nil; 16 | self.matchBlock = nil; 17 | self.failureMessageForToBlock = nil; 18 | self.failureMessageForNotToBlock = nil; 19 | 20 | [super dealloc]; 21 | } 22 | 23 | @synthesize prerequisiteBlock; 24 | @synthesize matchBlock; 25 | @synthesize failureMessageForToBlock; 26 | @synthesize failureMessageForNotToBlock; 27 | 28 | - (BOOL)meetsPrerequesiteFor:(id)actual 29 | { 30 | if (self.prerequisiteBlock) { 31 | return self.prerequisiteBlock(); 32 | } 33 | return YES; 34 | } 35 | 36 | - (BOOL)matches:(id)actual 37 | { 38 | if (self.matchBlock) { 39 | return self.matchBlock(); 40 | } 41 | return YES; 42 | } 43 | 44 | - (NSString *)failureMessageForTo:(id)actual 45 | { 46 | if (self.failureMessageForToBlock) { 47 | return self.failureMessageForToBlock(); 48 | } 49 | return nil; 50 | } 51 | 52 | - (NSString *)failureMessageForNotTo:(id)actual 53 | { 54 | if (self.failureMessageForNotToBlock) { 55 | return self.failureMessageForNotToBlock(); 56 | } 57 | return nil; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/EXPDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // EXPDefines.h 3 | // Expecta 4 | // 5 | // Created by Luke Redpath on 26/03/2012. 6 | // Copyright (c) 2012 Peter Jihoon Kim. All rights reserved. 7 | // 8 | 9 | #ifndef Expecta_EXPDefines_h 10 | #define Expecta_EXPDefines_h 11 | 12 | typedef void (^EXPBasicBlock)(void); 13 | typedef id (^EXPIdBlock)(void); 14 | typedef BOOL (^EXPBoolBlock)(void); 15 | typedef NSString *(^EXPStringBlock)(void); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/EXPDoubleTuple.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface EXPDoubleTuple : NSObject { 4 | double *_values; 5 | size_t _size; 6 | } 7 | 8 | @property (nonatomic, assign) double *values; 9 | @property (nonatomic, assign) size_t size; 10 | 11 | - (instancetype)initWithDoubleValues:(double *)values size:(size_t)size NS_DESIGNATED_INITIALIZER; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/EXPDoubleTuple.m: -------------------------------------------------------------------------------- 1 | #import "EXPDoubleTuple.h" 2 | 3 | #pragma clang diagnostic push 4 | #pragma clang diagnostic ignored "-Wobjc-designated-initializers" 5 | @implementation EXPDoubleTuple 6 | #pragma clang diagnostic pop 7 | 8 | @synthesize values = _values, size = _size; 9 | 10 | - (instancetype)initWithDoubleValues:(double *)values size:(size_t)size { 11 | if ((self = [super init])) { 12 | self.values = malloc(sizeof(double) * size); 13 | memcpy(self.values, values, sizeof(double) * size); 14 | self.size = size; 15 | } 16 | return self; 17 | } 18 | 19 | - (void)dealloc { 20 | free(self.values); 21 | [super dealloc]; 22 | } 23 | 24 | - (BOOL)isEqual:(id)object { 25 | if (![object isKindOfClass:[EXPDoubleTuple class]]) return NO; 26 | EXPDoubleTuple *other = (EXPDoubleTuple *)object; 27 | if (self.size == other.size) { 28 | for (int i = 0; i < self.size; ++i) { 29 | if (self.values[i] != other.values[i]) return NO; 30 | } 31 | return YES; 32 | } 33 | return NO; 34 | } 35 | 36 | - (NSString *)description { 37 | if (self.size == 2) { 38 | return [NSString stringWithFormat:@"Double tuple: {%f, %f}", self.values[0], self.values[1]]; 39 | } else if (self.size == 4) { 40 | return [NSString stringWithFormat:@"Double tuple: {%f, %f, %f, %f}", self.values[0], self.values[1], self.values[2], self.values[3]]; 41 | } 42 | return [NSString stringWithFormat:@"Double tuple of unexpected size %zd, sadly", self.size]; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/EXPExpect.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "EXPMatcher.h" 3 | #import "EXPDefines.h" 4 | 5 | @interface EXPExpect : NSObject { 6 | EXPIdBlock _actualBlock; 7 | id _testCase; 8 | int _lineNumber; 9 | char *_fileName; 10 | BOOL _negative; 11 | BOOL _asynchronous; 12 | NSTimeInterval _timeout; 13 | } 14 | 15 | @property(nonatomic, copy) EXPIdBlock actualBlock; 16 | @property(nonatomic, readonly) id actual; 17 | @property(nonatomic, assign) id testCase; 18 | @property(nonatomic) int lineNumber; 19 | @property(nonatomic) const char *fileName; 20 | @property(nonatomic) BOOL negative; 21 | @property(nonatomic) BOOL asynchronous; 22 | @property(nonatomic) NSTimeInterval timeout; 23 | 24 | @property(nonatomic, readonly) EXPExpect *to; 25 | @property(nonatomic, readonly) EXPExpect *toNot; 26 | @property(nonatomic, readonly) EXPExpect *notTo; 27 | @property(nonatomic, readonly) EXPExpect *will; 28 | @property(nonatomic, readonly) EXPExpect *willNot; 29 | @property(nonatomic, readonly) EXPExpect *(^after)(NSTimeInterval timeInterval); 30 | 31 | - (instancetype)initWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName NS_DESIGNATED_INITIALIZER; 32 | + (EXPExpect *)expectWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName; 33 | 34 | - (void)applyMatcher:(id)matcher; 35 | - (void)applyMatcher:(id)matcher to:(NSObject **)actual; 36 | 37 | @end 38 | 39 | @interface EXPDynamicPredicateMatcher : NSObject { 40 | EXPExpect *_expectation; 41 | SEL _selector; 42 | } 43 | - (instancetype)initWithExpectation:(EXPExpect *)expectation selector:(SEL)selector NS_DESIGNATED_INITIALIZER; 44 | @property (nonatomic, readonly, copy) void (^dispatch)(void); 45 | @end 46 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/EXPFloatTuple.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface EXPFloatTuple : NSObject { 4 | float *_values; 5 | size_t _size; 6 | } 7 | 8 | @property (nonatomic, assign) float *values; 9 | @property (nonatomic, assign) size_t size; 10 | 11 | - (instancetype)initWithFloatValues:(float *)values size:(size_t)size NS_DESIGNATED_INITIALIZER; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/EXPFloatTuple.m: -------------------------------------------------------------------------------- 1 | #import "EXPFloatTuple.h" 2 | 3 | #pragma clang diagnostic push 4 | #pragma clang diagnostic ignored "-Wobjc-designated-initializers" 5 | @implementation EXPFloatTuple 6 | #pragma clang diagnostic pop 7 | 8 | @synthesize values = _values, size = _size; 9 | 10 | - (instancetype)initWithFloatValues:(float *)values size:(size_t)size { 11 | if ((self = [super init])) { 12 | self.values = malloc(sizeof(float) * size); 13 | memcpy(self.values, values, sizeof(float) * size); 14 | self.size = size; 15 | } 16 | return self; 17 | } 18 | 19 | - (void)dealloc { 20 | free(self.values); 21 | [super dealloc]; 22 | } 23 | 24 | - (BOOL)isEqual:(id)object { 25 | if (![object isKindOfClass:[EXPFloatTuple class]]) return NO; 26 | EXPFloatTuple *other = (EXPFloatTuple *)object; 27 | if (self.size == other.size) { 28 | for (int i = 0; i < self.size; ++i) { 29 | if (self.values[i] != other.values[i]) return NO; 30 | } 31 | return YES; 32 | } 33 | return NO; 34 | } 35 | 36 | - (NSUInteger)hash 37 | { 38 | NSUInteger prime = 31; 39 | NSUInteger hash = 0; 40 | for (int i=0; i 10 | 11 | @protocol EXPMatcher 12 | 13 | - (BOOL)matches:(id)actual; 14 | 15 | @optional 16 | - (BOOL)meetsPrerequesiteFor:(id)actual; 17 | - (NSString *)failureMessageForTo:(id)actual; 18 | - (NSString *)failureMessageForNotTo:(id)actual; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/EXPUnsupportedObject.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface EXPUnsupportedObject : NSObject { 4 | NSString *_type; 5 | } 6 | 7 | @property (nonatomic, retain) NSString *type; 8 | 9 | - (instancetype)initWithType:(NSString *)type NS_DESIGNATED_INITIALIZER; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/EXPUnsupportedObject.m: -------------------------------------------------------------------------------- 1 | #import "EXPUnsupportedObject.h" 2 | 3 | #pragma clang diagnostic push 4 | #pragma clang diagnostic ignored "-Wobjc-designated-initializers" 5 | @implementation EXPUnsupportedObject 6 | #pragma clang diagnostic pop 7 | 8 | @synthesize type=_type; 9 | 10 | - (instancetype)initWithType:(NSString *)type { 11 | self = [super init]; 12 | if(self) { 13 | self.type = type; 14 | } 15 | return self; 16 | } 17 | 18 | - (void)dealloc { 19 | self.type = nil; 20 | [super dealloc]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Expecta.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | //! Project version number for Expecta. 4 | FOUNDATION_EXPORT double ExpectaVersionNumber; 5 | 6 | //! Project version string for Expecta. 7 | FOUNDATION_EXPORT const unsigned char ExpectaVersionString[]; 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | // Enable shorthand by default 14 | #define expect(...) EXP_expect((__VA_ARGS__)) 15 | #define failure(...) EXP_failure((__VA_ARGS__)) 16 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/ExpectaObject.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #define EXPObjectify(value) _EXPObjectify(@encode(__typeof__((value))), (value)) 4 | #define EXP_expect(actual) _EXP_expect(self, __LINE__, __FILE__, ^id{ __typeof__((actual)) strongActual = (actual); return EXPObjectify(strongActual); }) 5 | #define EXPMatcherInterface(matcherName, matcherArguments) _EXPMatcherInterface(matcherName, matcherArguments) 6 | #define EXPMatcherImplementationBegin(matcherName, matcherArguments) _EXPMatcherImplementationBegin(matcherName, matcherArguments) 7 | #define EXPMatcherImplementationEnd _EXPMatcherImplementationEnd 8 | #define EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments) _EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments) 9 | 10 | #define EXP_failure(message) EXPFail(self, __LINE__, __FILE__, message) 11 | 12 | 13 | @interface Expecta : NSObject 14 | 15 | + (NSTimeInterval)asynchronousTestTimeout; 16 | + (void)setAsynchronousTestTimeout:(NSTimeInterval)timeout; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/ExpectaObject.m: -------------------------------------------------------------------------------- 1 | #import "ExpectaObject.h" 2 | 3 | @implementation Expecta 4 | 5 | static NSTimeInterval _asynchronousTestTimeout = 1.0; 6 | 7 | + (NSTimeInterval)asynchronousTestTimeout { 8 | return _asynchronousTestTimeout; 9 | } 10 | 11 | + (void)setAsynchronousTestTimeout:(NSTimeInterval)timeout { 12 | _asynchronousTestTimeout = timeout; 13 | } 14 | 15 | @end -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | BOOL EXPIsValuePointer(NSValue *value); 4 | BOOL EXPIsNumberFloat(NSNumber *number); 5 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatcherHelpers.h" 2 | 3 | BOOL EXPIsValuePointer(NSValue *value) { 4 | return [value objCType][0] == @encode(void *)[0]; 5 | } 6 | 7 | BOOL EXPIsNumberFloat(NSNumber *number) { 8 | return strcmp([number objCType], @encode(float)) == 0; 9 | } 10 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(_beCloseToWithin, (id expected, id within)); 4 | EXPMatcherInterface(beCloseToWithin, (id expected, id within)); 5 | 6 | #define beCloseTo(expected) _beCloseToWithin(EXPObjectify((expected)), nil) 7 | #define beCloseToWithin(expected, range) _beCloseToWithin(EXPObjectify((expected)), EXPObjectify((range))) 8 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beCloseTo.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(_beCloseToWithin, (id expected, id within)) { 5 | prerequisite(^BOOL{ 6 | return [actual isKindOfClass:[NSNumber class]] && 7 | [expected isKindOfClass:[NSNumber class]] && 8 | ([within isKindOfClass:[NSNumber class]] || (within == nil)); 9 | }); 10 | 11 | match(^BOOL{ 12 | double actualValue = [actual doubleValue]; 13 | double expectedValue = [expected doubleValue]; 14 | 15 | if (within != nil) { 16 | double withinValue = [within doubleValue]; 17 | double lowerBound = expectedValue - withinValue; 18 | double upperBound = expectedValue + withinValue; 19 | return (actualValue >= lowerBound) && (actualValue <= upperBound); 20 | } else { 21 | double diff = fabs(actualValue - expectedValue); 22 | actualValue = fabs(actualValue); 23 | expectedValue = fabs(expectedValue); 24 | double largest = (expectedValue > actualValue) ? expectedValue : actualValue; 25 | return (diff <= largest * FLT_EPSILON); 26 | } 27 | }); 28 | 29 | failureMessageForTo(^NSString *{ 30 | if (within) { 31 | return [NSString stringWithFormat:@"expected %@ to be close to %@ within %@", 32 | EXPDescribeObject(actual), EXPDescribeObject(expected), EXPDescribeObject(within)]; 33 | } else { 34 | return [NSString stringWithFormat:@"expected %@ to be close to %@", 35 | EXPDescribeObject(actual), EXPDescribeObject(expected)]; 36 | } 37 | }); 38 | 39 | failureMessageForNotTo(^NSString *{ 40 | if (within) { 41 | return [NSString stringWithFormat:@"expected %@ not to be close to %@ within %@", 42 | EXPDescribeObject(actual), EXPDescribeObject(expected), EXPDescribeObject(within)]; 43 | } else { 44 | return [NSString stringWithFormat:@"expected %@ not to be close to %@", 45 | EXPDescribeObject(actual), EXPDescribeObject(expected)]; 46 | } 47 | }); 48 | } 49 | EXPMatcherImplementationEnd -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(beFalsy, (void)); 4 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beFalsy.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(beFalsy, (void)) { 5 | match(^BOOL{ 6 | if([actual isKindOfClass:[NSNumber class]]) { 7 | return ![(NSNumber *)actual boolValue]; 8 | } else if([actual isKindOfClass:[NSValue class]]) { 9 | if(EXPIsValuePointer((NSValue *)actual)) { 10 | return ![(NSValue *)actual pointerValue]; 11 | } 12 | } 13 | return !actual; 14 | }); 15 | 16 | failureMessageForTo(^NSString *{ 17 | return [NSString stringWithFormat:@"expected: a falsy value, got: %@, which is truthy", EXPDescribeObject(actual)]; 18 | }); 19 | 20 | failureMessageForNotTo(^NSString *{ 21 | return [NSString stringWithFormat:@"expected: a non-falsy value, got: %@, which is falsy", EXPDescribeObject(actual)]; 22 | }); 23 | } 24 | EXPMatcherImplementationEnd 25 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(_beGreaterThan, (id expected)); 4 | EXPMatcherInterface(beGreaterThan, (id expected)); 5 | 6 | #define beGreaterThan(expected) _beGreaterThan(EXPObjectify((expected))) 7 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beGreaterThan.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(_beGreaterThan, (id expected)) { 5 | match(^BOOL{ 6 | if ([actual respondsToSelector:@selector(compare:)]) { 7 | return [actual compare:expected] == NSOrderedDescending; 8 | } 9 | return NO; 10 | }); 11 | 12 | failureMessageForTo(^NSString *{ 13 | return [NSString stringWithFormat:@"expected: %@ to be greater than %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; 14 | }); 15 | 16 | failureMessageForNotTo(^NSString *{ 17 | return [NSString stringWithFormat:@"expected: %@ not to be greater than %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; 18 | }); 19 | } 20 | EXPMatcherImplementationEnd -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(_beGreaterThanOrEqualTo, (id expected)); 4 | EXPMatcherInterface(beGreaterThanOrEqualTo, (id expected)); 5 | 6 | #define beGreaterThanOrEqualTo(expected) _beGreaterThanOrEqualTo(EXPObjectify((expected))) 7 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beGreaterThanOrEqualTo.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(_beGreaterThanOrEqualTo, (id expected)) { 5 | match(^BOOL{ 6 | if ([actual respondsToSelector:@selector(compare:)]) { 7 | return [actual compare:expected] != NSOrderedAscending; 8 | } 9 | return NO; 10 | }); 11 | 12 | failureMessageForTo(^NSString *{ 13 | return [NSString stringWithFormat:@"expected: %@ to be greater than or equal to %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; 14 | }); 15 | 16 | failureMessageForNotTo(^NSString *{ 17 | return [NSString stringWithFormat:@"expected: %@ not to be greater than or equal to %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; 18 | }); 19 | } 20 | EXPMatcherImplementationEnd -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(_beIdenticalTo, (void *expected)); 4 | EXPMatcherInterface(beIdenticalTo, (void *expected)); // to aid code completion 5 | 6 | #if __has_feature(objc_arc) 7 | #define beIdenticalTo(expected) _beIdenticalTo((__bridge void*)expected) 8 | #else 9 | #define beIdenticalTo(expected) _beIdenticalTo(expected) 10 | #endif 11 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+equal.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(_beIdenticalTo, (void *expected)) { 5 | match(^BOOL{ 6 | if(actual == expected) { 7 | return YES; 8 | } else if([actual isKindOfClass:[NSValue class]] && EXPIsValuePointer((NSValue *)actual)) { 9 | if([(NSValue *)actual pointerValue] == expected) { 10 | return YES; 11 | } 12 | } 13 | return NO; 14 | }); 15 | 16 | failureMessageForTo(^NSString *{ 17 | return [NSString stringWithFormat:@"expected: <%p>, got: <%p>", expected, actual]; 18 | }); 19 | 20 | failureMessageForNotTo(^NSString *{ 21 | return [NSString stringWithFormat:@"expected: not <%p>, got: <%p>", expected, actual]; 22 | }); 23 | } 24 | EXPMatcherImplementationEnd 25 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(_beInTheRangeOf, (id expectedLowerBound, id expectedUpperBound)); 4 | EXPMatcherInterface(beInTheRangeOf, (id expectedLowerBound, id expectedUpperBound)); 5 | 6 | #define beInTheRangeOf(expectedLowerBound, expectedUpperBound) _beInTheRangeOf(EXPObjectify((expectedLowerBound)), EXPObjectify((expectedUpperBound))) 7 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beInTheRangeOf.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(_beInTheRangeOf, (id expectedLowerBound, id expectedUpperBound)) { 5 | match(^BOOL{ 6 | if ([actual respondsToSelector:@selector(compare:)]) { 7 | NSComparisonResult compareLowerBound = [expectedLowerBound compare: actual]; 8 | NSComparisonResult compareUpperBound = [expectedUpperBound compare: actual]; 9 | if (compareLowerBound == NSOrderedSame) { 10 | return YES; 11 | } 12 | if (compareUpperBound == NSOrderedSame) { 13 | return YES; 14 | } 15 | if ((compareLowerBound == NSOrderedAscending) && (compareUpperBound == NSOrderedDescending)) { 16 | return YES; 17 | } 18 | } 19 | return NO; 20 | }); 21 | 22 | failureMessageForTo(^NSString *{ 23 | return [NSString stringWithFormat:@"expected: %@ to be in the range [%@, %@] (inclusive)", EXPDescribeObject(actual), EXPDescribeObject(expectedLowerBound), EXPDescribeObject(expectedUpperBound)]; 24 | }); 25 | 26 | failureMessageForNotTo(^NSString *{ 27 | return [NSString stringWithFormat:@"expected: %@ not to be in the range [%@, %@] (inclusive)", EXPDescribeObject(actual), EXPDescribeObject(expectedLowerBound), EXPDescribeObject(expectedUpperBound)]; 28 | }); 29 | } 30 | EXPMatcherImplementationEnd -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(beInstanceOf, (Class expected)); 4 | EXPMatcherInterface(beAnInstanceOf, (Class expected)); 5 | EXPMatcherInterface(beMemberOf, (Class expected)); 6 | EXPMatcherInterface(beAMemberOf, (Class expected)); 7 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beInstanceOf.h" 2 | 3 | EXPMatcherImplementationBegin(beInstanceOf, (Class expected)) { 4 | BOOL actualIsNil = (actual == nil); 5 | BOOL expectedIsNil = (expected == nil); 6 | 7 | prerequisite(^BOOL{ 8 | return !(actualIsNil || expectedIsNil); 9 | }); 10 | 11 | match(^BOOL{ 12 | return [actual isMemberOfClass:expected]; 13 | }); 14 | 15 | failureMessageForTo(^NSString *{ 16 | if(actualIsNil) return @"the actual value is nil/null"; 17 | if(expectedIsNil) return @"the expected value is nil/null"; 18 | return [NSString stringWithFormat:@"expected: an instance of %@, got: an instance of %@", [expected class], [actual class]]; 19 | }); 20 | 21 | failureMessageForNotTo(^NSString *{ 22 | if(actualIsNil) return @"the actual value is nil/null"; 23 | if(expectedIsNil) return @"the expected value is nil/null"; 24 | return [NSString stringWithFormat:@"expected: not an instance of %@, got: an instance of %@", [expected class], [actual class]]; 25 | }); 26 | } 27 | EXPMatcherImplementationEnd 28 | 29 | EXPMatcherAliasImplementation(beAnInstanceOf, beInstanceOf, (Class expected)); 30 | EXPMatcherAliasImplementation(beMemberOf, beInstanceOf, (Class expected)); 31 | EXPMatcherAliasImplementation(beAMemberOf, beInstanceOf, (Class expected)); 32 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(beKindOf, (Class expected)); 4 | EXPMatcherInterface(beAKindOf, (Class expected)); 5 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beKindOf.h" 2 | 3 | EXPMatcherImplementationBegin(beKindOf, (Class expected)) { 4 | BOOL actualIsNil = (actual == nil); 5 | BOOL expectedIsNil = (expected == nil); 6 | 7 | prerequisite(^BOOL{ 8 | return !(actualIsNil || expectedIsNil); 9 | }); 10 | 11 | match(^BOOL{ 12 | return [actual isKindOfClass:expected]; 13 | }); 14 | 15 | failureMessageForTo(^NSString *{ 16 | if(actualIsNil) return @"the actual value is nil/null"; 17 | if(expectedIsNil) return @"the expected value is nil/null"; 18 | return [NSString stringWithFormat:@"expected: a kind of %@, got: an instance of %@, which is not a kind of %@", [expected class], [actual class], [expected class]]; 19 | }); 20 | 21 | failureMessageForNotTo(^NSString *{ 22 | if(actualIsNil) return @"the actual value is nil/null"; 23 | if(expectedIsNil) return @"the expected value is nil/null"; 24 | return [NSString stringWithFormat:@"expected: not a kind of %@, got: an instance of %@, which is a kind of %@", [expected class], [actual class], [expected class]]; 25 | }); 26 | } 27 | EXPMatcherImplementationEnd 28 | 29 | EXPMatcherAliasImplementation(beAKindOf, beKindOf, (Class expected)); 30 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThan.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(_beLessThan, (id expected)); 4 | EXPMatcherInterface(beLessThan, (id expected)); 5 | 6 | #define beLessThan(expected) _beLessThan(EXPObjectify((expected))) 7 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThan.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beLessThan.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(_beLessThan, (id expected)) { 5 | match(^BOOL{ 6 | if ([actual respondsToSelector:@selector(compare:)]) { 7 | return [actual compare:expected] == NSOrderedAscending; 8 | } 9 | return NO; 10 | }); 11 | 12 | failureMessageForTo(^NSString *{ 13 | return [NSString stringWithFormat:@"expected: %@ to be less than %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; 14 | }); 15 | 16 | failureMessageForNotTo(^NSString *{ 17 | return [NSString stringWithFormat:@"expected: %@ not to be less than %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; 18 | }); 19 | } 20 | EXPMatcherImplementationEnd -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(_beLessThanOrEqualTo, (id expected)); 4 | EXPMatcherInterface(beLessThanOrEqualTo, (id expected)); 5 | 6 | #define beLessThanOrEqualTo(expected) _beLessThanOrEqualTo(EXPObjectify((expected))) 7 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThanOrEqualTo.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beLessThanOrEqualTo.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(_beLessThanOrEqualTo, (id expected)) { 5 | match(^BOOL{ 6 | if ([actual respondsToSelector:@selector(compare:)]) { 7 | return [actual compare:expected] != NSOrderedDescending; 8 | } 9 | return NO; 10 | }); 11 | 12 | failureMessageForTo(^NSString *{ 13 | return [NSString stringWithFormat:@"expected: %@ to be less than or equal to %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; 14 | }); 15 | 16 | failureMessageForNotTo(^NSString *{ 17 | return [NSString stringWithFormat:@"expected: %@ not to be less than or equal to %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; 18 | }); 19 | } 20 | EXPMatcherImplementationEnd -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beNil.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(beNil, (void)); 4 | EXPMatcherInterface(beNull, (void)); 5 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beNil.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beNil.h" 2 | 3 | EXPMatcherImplementationBegin(beNil, (void)) { 4 | match(^BOOL{ 5 | return actual == nil; 6 | }); 7 | 8 | failureMessageForTo(^NSString *{ 9 | return [NSString stringWithFormat:@"expected: nil/null, got: %@", EXPDescribeObject(actual)]; 10 | }); 11 | 12 | failureMessageForNotTo(^NSString *{ 13 | return [NSString stringWithFormat:@"expected: not nil/null, got: %@", EXPDescribeObject(actual)]; 14 | }); 15 | } 16 | EXPMatcherImplementationEnd 17 | 18 | EXPMatcherAliasImplementation(beNull, beNil, (void)); 19 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beSubclassOf.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(beSubclassOf, (Class expected)); 4 | EXPMatcherInterface(beASubclassOf, (Class expected)); 5 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beSubclassOf.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beSubclassOf.h" 2 | #import "NSValue+Expecta.h" 3 | #import 4 | 5 | EXPMatcherImplementationBegin(beSubclassOf, (Class expected)) { 6 | __block BOOL actualIsClass = YES; 7 | 8 | prerequisite(^BOOL { 9 | actualIsClass = class_isMetaClass(object_getClass(actual)); 10 | return actualIsClass; 11 | }); 12 | 13 | match(^BOOL{ 14 | return [actual isSubclassOfClass:expected]; 15 | }); 16 | 17 | failureMessageForTo(^NSString *{ 18 | if(!actualIsClass) return @"the actual value is not a Class"; 19 | return [NSString stringWithFormat:@"expected: a subclass of %@, got: a class %@, which is not a subclass of %@", [expected class], actual, [expected class]]; 20 | }); 21 | 22 | failureMessageForNotTo(^NSString *{ 23 | if(!actualIsClass) return @"the actual value is not a Class"; 24 | return [NSString stringWithFormat:@"expected: not a subclass of %@, got: a class %@, which is a subclass of %@", [expected class], actual, [expected class]]; 25 | }); 26 | } 27 | EXPMatcherImplementationEnd 28 | 29 | EXPMatcherAliasImplementation(beASubclassOf, beSubclassOf, (Class expected)); 30 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beSupersetOf.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(beSupersetOf, (id subset)); 4 | 5 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beTruthy.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(beTruthy, (void)); 4 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beTruthy.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beTruthy.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(beTruthy, (void)) { 5 | match(^BOOL{ 6 | if([actual isKindOfClass:[NSNumber class]]) { 7 | return !![(NSNumber *)actual boolValue]; 8 | } else if([actual isKindOfClass:[NSValue class]]) { 9 | if(EXPIsValuePointer((NSValue *)actual)) { 10 | return !![(NSValue *)actual pointerValue]; 11 | } 12 | } 13 | return !!actual; 14 | }); 15 | 16 | failureMessageForTo(^NSString *{ 17 | return [NSString stringWithFormat:@"expected: a truthy value, got: %@, which is falsy", EXPDescribeObject(actual)]; 18 | }); 19 | 20 | failureMessageForNotTo(^NSString *{ 21 | return [NSString stringWithFormat:@"expected: a non-truthy value, got: %@, which is truthy", EXPDescribeObject(actual)]; 22 | }); 23 | } 24 | EXPMatcherImplementationEnd 25 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+beginWith.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(beginWith, (id expected)); 4 | EXPMatcherInterface(startWith, (id expected)); 5 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+conformTo.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(conformTo, (Protocol *expected)); 4 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+conformTo.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+conformTo.h" 2 | #import "NSValue+Expecta.h" 3 | #import 4 | 5 | EXPMatcherImplementationBegin(conformTo, (Protocol *expected)) { 6 | BOOL actualIsNil = (actual == nil); 7 | BOOL expectedIsNil = (expected == nil); 8 | 9 | prerequisite(^BOOL{ 10 | return !(actualIsNil || expectedIsNil); 11 | }); 12 | 13 | match(^BOOL{ 14 | return [actual conformsToProtocol:expected]; 15 | }); 16 | 17 | failureMessageForTo(^NSString *{ 18 | if(actualIsNil) return @"the object is nil/null"; 19 | if(expectedIsNil) return @"the protocol is nil/null"; 20 | 21 | NSString *name = NSStringFromProtocol(expected); 22 | return [NSString stringWithFormat:@"expected: %@ to conform to %@", actual, name]; 23 | }); 24 | 25 | failureMessageForNotTo(^NSString *{ 26 | if(actualIsNil) return @"the object is nil/null"; 27 | if(expectedIsNil) return @"the protocol is nil/null"; 28 | 29 | NSString *name = NSStringFromProtocol(expected); 30 | return [NSString stringWithFormat:@"expected: %@ not to conform to %@", actual, name]; 31 | }); 32 | } 33 | EXPMatcherImplementationEnd 34 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+contain.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(_contain, (id expected)); 4 | EXPMatcherInterface(contain, (id expected)); // to aid code completion 5 | #define contain(expected) _contain(EXPObjectify((expected))) 6 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+contain.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+contain.h" 2 | 3 | EXPMatcherImplementationBegin(_contain, (id expected)) { 4 | BOOL actualIsCompatible = [actual isKindOfClass:[NSString class]] || [actual conformsToProtocol:@protocol(NSFastEnumeration)]; 5 | BOOL expectedIsNil = (expected == nil); 6 | 7 | prerequisite(^BOOL{ 8 | return actualIsCompatible && !expectedIsNil; 9 | }); 10 | 11 | match(^BOOL{ 12 | if(actualIsCompatible) { 13 | if([actual isKindOfClass:[NSString class]]) { 14 | return [(NSString *)actual rangeOfString:[expected description]].location != NSNotFound; 15 | } else { 16 | for (id object in actual) { 17 | if ([object isEqual:expected]) { 18 | return YES; 19 | } 20 | } 21 | } 22 | } 23 | return NO; 24 | }); 25 | 26 | failureMessageForTo(^NSString *{ 27 | if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString or NSFastEnumeration", EXPDescribeObject(actual)]; 28 | if(expectedIsNil) return @"the expected value is nil/null"; 29 | return [NSString stringWithFormat:@"expected %@ to contain %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; 30 | }); 31 | 32 | failureMessageForNotTo(^NSString *{ 33 | if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString or NSFastEnumeration", EXPDescribeObject(actual)]; 34 | if(expectedIsNil) return @"the expected value is nil/null"; 35 | return [NSString stringWithFormat:@"expected %@ not to contain %@", EXPDescribeObject(actual), EXPDescribeObject(expected)]; 36 | }); 37 | } 38 | EXPMatcherImplementationEnd 39 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+endWith.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(endWith, (id expected)); 4 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+equal.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(_equal, (id expected)); 4 | EXPMatcherInterface(equal, (id expected)); // to aid code completion 5 | #define equal(...) _equal(EXPObjectify((__VA_ARGS__))) 6 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+equal.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+equal.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(_equal, (id expected)) { 5 | match(^BOOL{ 6 | if((actual == expected) || [actual isEqual:expected]) { 7 | return YES; 8 | } else if([actual isKindOfClass:[NSNumber class]] && [expected isKindOfClass:[NSNumber class]]) { 9 | if([actual isKindOfClass:[NSDecimalNumber class]] || [expected isKindOfClass:[NSDecimalNumber class]]) { 10 | NSDecimalNumber *actualDecimalNumber = [NSDecimalNumber decimalNumberWithDecimal:[(NSNumber *) actual decimalValue]]; 11 | NSDecimalNumber *expectedDecimalNumber = [NSDecimalNumber decimalNumberWithDecimal:[(NSNumber *) expected decimalValue]]; 12 | return [actualDecimalNumber isEqualToNumber:expectedDecimalNumber]; 13 | } 14 | else { 15 | if(EXPIsNumberFloat((NSNumber *)actual) || EXPIsNumberFloat((NSNumber *)expected)) { 16 | return [(NSNumber *)actual floatValue] == [(NSNumber *)expected floatValue]; 17 | } 18 | } 19 | } 20 | return NO; 21 | }); 22 | 23 | failureMessageForTo(^NSString *{ 24 | NSString *expectedDescription = EXPDescribeObject(expected); 25 | NSString *actualDescription = EXPDescribeObject(actual); 26 | 27 | if (![expectedDescription isEqualToString:actualDescription]) { 28 | return [NSString stringWithFormat:@"expected: %@, got: %@", EXPDescribeObject(expected), EXPDescribeObject(actual)]; 29 | } else { 30 | return [NSString stringWithFormat:@"expected (%@): %@, got (%@): %@", NSStringFromClass([expected class]), EXPDescribeObject(expected), NSStringFromClass([actual class]), EXPDescribeObject(actual)]; 31 | } 32 | }); 33 | 34 | failureMessageForNotTo(^NSString *{ 35 | return [NSString stringWithFormat:@"expected: not %@, got: %@", EXPDescribeObject(expected), EXPDescribeObject(actual)]; 36 | }); 37 | } 38 | EXPMatcherImplementationEnd 39 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+haveCountOf.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(haveCountOf, (NSUInteger expected)); 4 | EXPMatcherInterface(haveCount, (NSUInteger expected)); 5 | EXPMatcherInterface(haveACountOf, (NSUInteger expected)); 6 | EXPMatcherInterface(haveLength, (NSUInteger expected)); 7 | EXPMatcherInterface(haveLengthOf, (NSUInteger expected)); 8 | EXPMatcherInterface(haveALengthOf, (NSUInteger expected)); 9 | 10 | #define beEmpty() haveCountOf(0) 11 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+haveCountOf.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+haveCountOf.h" 2 | 3 | EXPMatcherImplementationBegin(haveCountOf, (NSUInteger expected)) { 4 | BOOL actualIsStringy = [actual isKindOfClass:[NSString class]] || [actual isKindOfClass:[NSAttributedString class]]; 5 | BOOL actualIsCompatible = actualIsStringy || [actual respondsToSelector:@selector(count)]; 6 | 7 | prerequisite(^BOOL{ 8 | return actualIsCompatible; 9 | }); 10 | 11 | NSUInteger (^count)(id) = ^(id actual) { 12 | if(actualIsStringy) { 13 | return [actual length]; 14 | } else { 15 | return [actual count]; 16 | } 17 | }; 18 | 19 | match(^BOOL{ 20 | if(actualIsCompatible) { 21 | return count(actual) == expected; 22 | } 23 | return NO; 24 | }); 25 | 26 | failureMessageForTo(^NSString *{ 27 | if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString, NSAttributedString, NSArray, NSSet, NSOrderedSet, or NSDictionary", EXPDescribeObject(actual)]; 28 | return [NSString stringWithFormat:@"expected %@ to have a count of %zi but got %zi", EXPDescribeObject(actual), expected, count(actual)]; 29 | }); 30 | 31 | failureMessageForNotTo(^NSString *{ 32 | if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString, NSAttributedString, NSArray, NSSet, NSOrderedSet, or NSDictionary", EXPDescribeObject(actual)]; 33 | return [NSString stringWithFormat:@"expected %@ not to have a count of %zi", EXPDescribeObject(actual), expected]; 34 | }); 35 | } 36 | EXPMatcherImplementationEnd 37 | 38 | EXPMatcherAliasImplementation(haveCount, haveCountOf, (NSUInteger expected)); 39 | EXPMatcherAliasImplementation(haveACountOf, haveCountOf, (NSUInteger expected)); 40 | EXPMatcherAliasImplementation(haveLength, haveCountOf, (NSUInteger expected)); 41 | EXPMatcherAliasImplementation(haveLengthOf, haveCountOf, (NSUInteger expected)); 42 | EXPMatcherAliasImplementation(haveALengthOf, haveCountOf, (NSUInteger expected)); 43 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+match.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(match, (NSString *expected)); 4 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+match.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+match.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(match, (NSString *expected)) { 5 | BOOL actualIsNil = (actual == nil); 6 | BOOL expectedIsNil = (expected == nil); 7 | 8 | __block NSRegularExpression *regex = nil; 9 | __block NSError *regexError = nil; 10 | 11 | prerequisite (^BOOL { 12 | BOOL nilInput = (actualIsNil || expectedIsNil); 13 | if (!nilInput) { 14 | regex = [NSRegularExpression regularExpressionWithPattern:expected options:0 error:®exError]; 15 | } 16 | return !nilInput && regex; 17 | }); 18 | 19 | match(^BOOL { 20 | NSRange range = [regex rangeOfFirstMatchInString:actual options:0 range:NSMakeRange(0, [actual length])]; 21 | return !NSEqualRanges(range, NSMakeRange(NSNotFound, 0)); 22 | }); 23 | 24 | failureMessageForTo(^NSString *{ 25 | if (actualIsNil) return @"the object is nil/null"; 26 | if (expectedIsNil) return @"the expression is nil/null"; 27 | if (regexError) return [NSString stringWithFormat:@"unable to create regular expression from given parameter: %@", [regexError localizedDescription]]; 28 | return [NSString stringWithFormat:@"expected: %@ to match to %@", EXPDescribeObject(actual), expected]; 29 | }); 30 | 31 | failureMessageForNotTo(^NSString *{ 32 | if (actualIsNil) return @"the object is nil/null"; 33 | if (expectedIsNil) return @"the expression is nil/null"; 34 | if (regexError) return [NSString stringWithFormat:@"unable to create regular expression from given parameter: %@", [regexError localizedDescription]]; 35 | return [NSString stringWithFormat:@"expected: %@ not to match to %@", EXPDescribeObject(actual), expected]; 36 | }); 37 | } 38 | EXPMatcherImplementationEnd 39 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+postNotification.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(postNotification, (id expectedNotification)); 4 | EXPMatcherInterface(notify, (id expectedNotification)); 5 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+raise.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(raise, (NSString *expectedExceptionName)); 4 | #define raiseAny() raise(nil) 5 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+raise.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+raise.h" 2 | #import "EXPDefines.h" 3 | 4 | EXPMatcherImplementationBegin(raise, (NSString *expectedExceptionName)) { 5 | __block NSException *exceptionCaught = nil; 6 | 7 | match(^BOOL{ 8 | BOOL expectedExceptionCaught = NO; 9 | @try { 10 | ((EXPBasicBlock)actual)(); 11 | } @catch(NSException *e) { 12 | exceptionCaught = e; 13 | expectedExceptionCaught = (expectedExceptionName == nil) || [[exceptionCaught name] isEqualToString:expectedExceptionName]; 14 | } 15 | return expectedExceptionCaught; 16 | }); 17 | 18 | failureMessageForTo(^NSString *{ 19 | return [NSString stringWithFormat:@"expected: %@, got: %@", 20 | expectedExceptionName ? expectedExceptionName : @"any exception", 21 | exceptionCaught ? [exceptionCaught name] : @"no exception"]; 22 | }); 23 | 24 | failureMessageForNotTo(^NSString *{ 25 | return [NSString stringWithFormat:@"expected: %@, got: %@", 26 | expectedExceptionName ? [NSString stringWithFormat:@"not %@", expectedExceptionName] : @"no exception", 27 | exceptionCaught ? [exceptionCaught name] : @"no exception"]; 28 | }); 29 | } 30 | EXPMatcherImplementationEnd 31 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+raiseWithReason.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(raiseWithReason, (NSString *expectedExceptionName, NSString *expectedReason)); 4 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+raiseWithReason.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+raiseWithReason.h" 2 | #import "EXPDefines.h" 3 | 4 | EXPMatcherImplementationBegin(raiseWithReason, (NSString *expectedExceptionName, NSString *expectedReason)) { 5 | __block NSException *exceptionCaught = nil; 6 | 7 | match(^BOOL{ 8 | BOOL expectedExceptionCaught = NO; 9 | @try { 10 | ((EXPBasicBlock)actual)(); 11 | } @catch(NSException *e) { 12 | exceptionCaught = e; 13 | expectedExceptionCaught = (((expectedExceptionName == nil) || [[exceptionCaught name] isEqualToString:expectedExceptionName]) && 14 | ((expectedReason == nil) || ([[exceptionCaught reason] isEqualToString:expectedReason]))); 15 | } 16 | return expectedExceptionCaught; 17 | }); 18 | 19 | failureMessageForTo(^NSString *{ 20 | return [NSString stringWithFormat:@"expected: %@ (%@), got: %@ (%@)", 21 | expectedExceptionName ?: @"any exception", 22 | expectedReason ?: @"any reason", 23 | exceptionCaught ? [exceptionCaught name] : @"no exception", 24 | exceptionCaught ? [exceptionCaught reason] : @""]; 25 | }); 26 | 27 | failureMessageForNotTo(^NSString *{ 28 | return [NSString stringWithFormat:@"expected: %@ (%@), got: %@ (%@)", 29 | expectedExceptionName ? [NSString stringWithFormat:@"not %@", expectedExceptionName] : @"no exception", 30 | expectedReason ? [NSString stringWithFormat:@"not '%@'", expectedReason] : @"no reason", 31 | exceptionCaught ? [exceptionCaught name] : @"no exception", 32 | exceptionCaught ? [exceptionCaught reason] : @"no reason"]; 33 | }); 34 | } 35 | EXPMatcherImplementationEnd 36 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+respondTo.h: -------------------------------------------------------------------------------- 1 | #import "Expecta.h" 2 | 3 | EXPMatcherInterface(respondTo, (SEL expected)); 4 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers+respondTo.m: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+respondTo.h" 2 | #import "EXPMatcherHelpers.h" 3 | 4 | EXPMatcherImplementationBegin(respondTo, (SEL expected)) { 5 | BOOL actualIsNil = (actual == nil); 6 | BOOL expectedIsNull = (expected == NULL); 7 | 8 | prerequisite (^BOOL { 9 | return !(actualIsNil || expectedIsNull); 10 | }); 11 | 12 | match(^BOOL { 13 | if ([actual respondsToSelector:@selector(instancesRespondToSelector:)] && 14 | [actual instancesRespondToSelector:expected]) { 15 | return YES; 16 | } 17 | return [actual respondsToSelector:expected]; 18 | }); 19 | 20 | failureMessageForTo(^NSString *{ 21 | if (actualIsNil) return @"the object is nil/null"; 22 | if (expectedIsNull) return @"the selector is null"; 23 | return [NSString stringWithFormat:@"expected: %@ to respond to %@", EXPDescribeObject(actual), NSStringFromSelector(expected)]; 24 | }); 25 | 26 | failureMessageForNotTo(^NSString *{ 27 | if (actualIsNil) return @"the object is nil/null"; 28 | if (expectedIsNull) return @"the selector is null"; 29 | return [NSString stringWithFormat:@"expected: %@ not to respond to %@", EXPDescribeObject(actual), NSStringFromSelector(expected)]; 30 | }); 31 | } 32 | EXPMatcherImplementationEnd 33 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/Matchers/EXPMatchers.h: -------------------------------------------------------------------------------- 1 | #import "EXPMatchers+beNil.h" 2 | #import "EXPMatchers+equal.h" 3 | #import "EXPMatchers+beInstanceOf.h" 4 | #import "EXPMatchers+beKindOf.h" 5 | #import "EXPMatchers+beSubclassOf.h" 6 | #import "EXPMatchers+conformTo.h" 7 | #import "EXPMatchers+beTruthy.h" 8 | #import "EXPMatchers+beFalsy.h" 9 | #import "EXPMatchers+contain.h" 10 | #import "EXPMatchers+beSupersetOf.h" 11 | #import "EXPMatchers+haveCountOf.h" 12 | #import "EXPMatchers+beIdenticalTo.h" 13 | #import "EXPMatchers+beGreaterThan.h" 14 | #import "EXPMatchers+beGreaterThanOrEqualTo.h" 15 | #import "EXPMatchers+beLessThan.h" 16 | #import "EXPMatchers+beLessThanOrEqualTo.h" 17 | #import "EXPMatchers+beInTheRangeOf.h" 18 | #import "EXPMatchers+beCloseTo.h" 19 | #import "EXPMatchers+raise.h" 20 | #import "EXPMatchers+raiseWithReason.h" 21 | #import "EXPMatchers+respondTo.h" 22 | #import "EXPMatchers+postNotification.h" 23 | #import "EXPMatchers+beginWith.h" 24 | #import "EXPMatchers+endWith.h" 25 | #import "EXPMatchers+match.h" 26 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/NSObject+Expecta.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSObject (Expecta) 4 | 5 | - (void)recordFailureWithDescription:(NSString *)description 6 | inFile:(NSString *)filename 7 | atLine:(NSUInteger)lineNumber 8 | expected:(BOOL)expected; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/NSValue+Expecta.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSValue (Expecta) 4 | 5 | @property (nonatomic) const char *_EXP_objCType; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Pods/Expecta/Expecta/NSValue+Expecta.m: -------------------------------------------------------------------------------- 1 | #import "NSValue+Expecta.h" 2 | #import 3 | #import "Expecta.h" 4 | 5 | EXPFixCategoriesBug(NSValue_Expecta); 6 | 7 | @implementation NSValue (Expecta) 8 | 9 | static char _EXP_typeKey; 10 | 11 | - (const char *)_EXP_objCType { 12 | return [(NSString *)objc_getAssociatedObject(self, &_EXP_typeKey) cStringUsingEncoding:NSASCIIStringEncoding]; 13 | } 14 | 15 | - (void)set_EXP_objCType:(const char *)_EXP_objCType { 16 | objc_setAssociatedObject(self, &_EXP_typeKey, 17 | @(_EXP_objCType), 18 | OBJC_ASSOCIATION_COPY_NONATOMIC); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/Expecta/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2015 Specta Team - https://github.com/specta 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/Local Podspecs/WatchCon.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WatchCon", 3 | "version": "0.1", 4 | "summary": "WatchCon is a tool which enables creating easy connectivity between iOS and WatchOS", 5 | "homepage": "https://github.com/abdullahselek/WatchCon", 6 | "license": { 7 | "type": "MIT", 8 | "file": "LICENSE" 9 | }, 10 | "authors": { 11 | "Abdullah Selek": "abdullahselek@yahoo.com" 12 | }, 13 | "source": { 14 | "git": "https://github.com/abdullahselek/WatchCon.git", 15 | "tag": "0.1" 16 | }, 17 | "platforms": { 18 | "ios": "9.0", 19 | "watchos": "2.0" 20 | }, 21 | "source_files": "Sources/*.{h,m}", 22 | "requires_arc": true, 23 | "frameworks": "WatchConnectivity" 24 | } 25 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Expecta (1.0.6) 3 | - OCMock (3.4.1) 4 | - Quick (1.2.0) 5 | 6 | DEPENDENCIES: 7 | - Expecta 8 | - OCMock 9 | - Quick 10 | 11 | SPEC CHECKSUMS: 12 | Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5 13 | OCMock: 2cd0716969bab32a2283ff3a46fd26a8c8b4c5e3 14 | Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08 15 | 16 | PODFILE CHECKSUM: f0a029b181f562682d167c657b569a4bc2630c95 17 | 18 | COCOAPODS: 1.2.1 19 | -------------------------------------------------------------------------------- /Pods/OCMock/README.md: -------------------------------------------------------------------------------- 1 | OCMock 2 | ====== 3 | 4 | OCMock is an Objective-C implementation of mock objects. 5 | 6 | For downloads, documentation, and support please visit [ocmock.org][]. 7 | 8 | [![Build Status](https://travis-ci.org/erikdoe/ocmock.svg?branch=master)](https://travis-ci.org/erikdoe/ocmock) 9 | 10 | [ocmock.org]: http://ocmock.org/ 11 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSInvocation+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface NSInvocation(OCMAdditions) 20 | 21 | + (NSInvocation *)invocationForBlock:(id)block withArguments:(NSArray *)arguments; 22 | 23 | - (void)retainObjectArgumentsExcludingObject:(id)objectToExclude; 24 | 25 | - (id)getArgumentAtIndexAsObject:(NSInteger)argIndex; 26 | 27 | - (NSString *)invocationDescription; 28 | 29 | - (NSString *)argumentDescriptionAtIndex:(NSInteger)argIndex; 30 | 31 | - (NSString *)objectDescriptionAtIndex:(NSInteger)anInt; 32 | - (NSString *)charDescriptionAtIndex:(NSInteger)anInt; 33 | - (NSString *)unsignedCharDescriptionAtIndex:(NSInteger)anInt; 34 | - (NSString *)intDescriptionAtIndex:(NSInteger)anInt; 35 | - (NSString *)unsignedIntDescriptionAtIndex:(NSInteger)anInt; 36 | - (NSString *)shortDescriptionAtIndex:(NSInteger)anInt; 37 | - (NSString *)unsignedShortDescriptionAtIndex:(NSInteger)anInt; 38 | - (NSString *)longDescriptionAtIndex:(NSInteger)anInt; 39 | - (NSString *)unsignedLongDescriptionAtIndex:(NSInteger)anInt; 40 | - (NSString *)longLongDescriptionAtIndex:(NSInteger)anInt; 41 | - (NSString *)unsignedLongLongDescriptionAtIndex:(NSInteger)anInt; 42 | - (NSString *)doubleDescriptionAtIndex:(NSInteger)anInt; 43 | - (NSString *)floatDescriptionAtIndex:(NSInteger)anInt; 44 | - (NSString *)structDescriptionAtIndex:(NSInteger)anInt; 45 | - (NSString *)pointerDescriptionAtIndex:(NSInteger)anInt; 46 | - (NSString *)cStringDescriptionAtIndex:(NSInteger)anInt; 47 | - (NSString *)selectorDescriptionAtIndex:(NSInteger)anInt; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSMethodSignature+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface NSMethodSignature(OCMAdditions) 20 | 21 | + (NSMethodSignature *)signatureForDynamicPropertyAccessedWithSelector:(SEL)selector inClass:(Class)aClass; 22 | + (NSMethodSignature *)signatureForBlock:(id)block; 23 | 24 | - (BOOL)usesSpecialStructureReturn; 25 | 26 | - (NSString *)fullTypeString; 27 | - (const char *)fullObjCTypes; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCObserverMockObject; 20 | 21 | 22 | @interface NSNotificationCenter(OCMAdditions) 23 | 24 | - (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSNotificationCenter+OCMAdditions.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "NSNotificationCenter+OCMAdditions.h" 18 | #import "OCObserverMockObject.h" 19 | 20 | 21 | @implementation NSNotificationCenter(OCMAdditions) 22 | 23 | - (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender 24 | { 25 | [notificationObserver autoRemoveFromCenter:self]; 26 | [self addObserver:notificationObserver selector:@selector(handleNotification:) name:notificationName object:notificationSender]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSObject+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface NSObject(OCMAdditions) 20 | 21 | + (IMP)instanceMethodForwarderForSelector:(SEL)aSelector; 22 | + (void)enumerateMethodsInClass:(Class)aClass usingBlock:(void (^)(Class cls, SEL sel))aBlock; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/NSValue+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface NSValue(OCMAdditions) 20 | 21 | - (BOOL)getBytes:(void *)outputBuf objCType:(const char *)targetType; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCClassMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCClassMockObject : OCMockObject 20 | { 21 | Class mockedClass; 22 | Class originalMetaClass; 23 | } 24 | 25 | - (id)initWithClass:(Class)aClass; 26 | 27 | - (Class)mockedClass; 28 | - (Class)mockObjectClass; // since -class returns the mockedClass 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMArg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMArg : NSObject 20 | 21 | // constraining arguments 22 | 23 | + (id)any; 24 | + (SEL)anySelector; 25 | + (void *)anyPointer; 26 | + (id __autoreleasing *)anyObjectRef; 27 | + (id)isNil; 28 | + (id)isNotNil; 29 | + (id)isEqual:(id)value; 30 | + (id)isNotEqual:(id)value; 31 | + (id)isKindOfClass:(Class)cls; 32 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; 33 | + (id)checkWithBlock:(BOOL (^)(id obj))block; 34 | 35 | // manipulating arguments 36 | 37 | + (id *)setTo:(id)value; 38 | + (void *)setToValue:(NSValue *)value; 39 | + (id)invokeBlock; 40 | + (id)invokeBlockWithArgs:(id)first,... NS_REQUIRES_NIL_TERMINATION; 41 | 42 | + (id)defaultValue; 43 | 44 | // internal use only 45 | 46 | + (id)resolveSpecialValues:(NSValue *)value; 47 | 48 | @end 49 | 50 | #define OCMOCK_ANY [OCMArg any] 51 | 52 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 53 | #define OCMOCK_VALUE(variable) \ 54 | ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) 55 | #else 56 | #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMArgAction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMArgAction : NSObject 20 | 21 | - (void)handleArgument:(id)argument; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMArgAction.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMArgAction.h" 18 | 19 | 20 | @implementation OCMArgAction 21 | 22 | - (void)handleArgument:(id)argument 23 | { 24 | 25 | } 26 | 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMBlockArgCaller.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMArgAction.h" 18 | 19 | @interface OCMBlockArgCaller : OCMArgAction 20 | { 21 | NSArray *arguments; 22 | } 23 | 24 | - (instancetype)initWithBlockArguments:(NSArray *)someArgs; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMBlockArgCaller.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMBlockArgCaller.h" 18 | #import "NSInvocation+OCMAdditions.h" 19 | 20 | 21 | @implementation OCMBlockArgCaller 22 | 23 | - (instancetype)initWithBlockArguments:(NSArray *)someArgs 24 | { 25 | self = [super init]; 26 | if(self) 27 | { 28 | arguments = [someArgs copy]; 29 | } 30 | return self; 31 | } 32 | 33 | - (void)dealloc 34 | { 35 | [arguments release]; 36 | [super dealloc]; 37 | } 38 | 39 | - (id)copyWithZone:(NSZone *)zone 40 | { 41 | return [self retain]; 42 | } 43 | 44 | - (void)handleArgument:(id)aBlock 45 | { 46 | if(aBlock) 47 | { 48 | NSInvocation *inv = [NSInvocation invocationForBlock:aBlock withArguments:arguments]; 49 | [inv invokeWithTarget:aBlock]; 50 | } 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMBlockCaller.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | @interface OCMBlockCaller : NSObject 21 | { 22 | void (^block)(NSInvocation *); 23 | } 24 | 25 | - (id)initWithCallBlock:(void (^)(NSInvocation *))theBlock; 26 | 27 | - (void)handleInvocation:(NSInvocation *)anInvocation; 28 | 29 | @end 30 | 31 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMBlockCaller.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMBlockCaller.h" 18 | 19 | 20 | @implementation OCMBlockCaller 21 | 22 | -(id)initWithCallBlock:(void (^)(NSInvocation *))theBlock 23 | { 24 | if ((self = [super init])) 25 | { 26 | block = [theBlock copy]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | -(void)dealloc 33 | { 34 | [block release]; 35 | [super dealloc]; 36 | } 37 | 38 | - (void)handleInvocation:(NSInvocation *)anInvocation 39 | { 40 | if (block != nil) 41 | { 42 | block(anInvocation); 43 | } 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMBoxedReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMReturnValueProvider.h" 18 | 19 | @interface OCMBoxedReturnValueProvider : OCMReturnValueProvider 20 | { 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMBoxedReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMBoxedReturnValueProvider.h" 18 | #import "OCMFunctionsPrivate.h" 19 | #import "NSValue+OCMAdditions.h" 20 | 21 | @implementation OCMBoxedReturnValueProvider 22 | 23 | - (void)handleInvocation:(NSInvocation *)anInvocation 24 | { 25 | const char *returnType = [[anInvocation methodSignature] methodReturnType]; 26 | NSUInteger returnTypeSize = [[anInvocation methodSignature] methodReturnLength]; 27 | char valueBuffer[returnTypeSize]; 28 | NSValue *returnValueAsNSValue = (NSValue *)returnValue; 29 | 30 | if([self isMethodReturnType:returnType compatibleWithValueType:[returnValueAsNSValue objCType]]) 31 | { 32 | [returnValueAsNSValue getValue:valueBuffer]; 33 | [anInvocation setReturnValue:valueBuffer]; 34 | } 35 | else if([returnValueAsNSValue getBytes:valueBuffer objCType:returnType]) 36 | { 37 | [anInvocation setReturnValue:valueBuffer]; 38 | } 39 | else 40 | { 41 | [NSException raise:NSInvalidArgumentException 42 | format:@"Return value cannot be used for method; method signature declares '%s' but value is '%s'.", returnType, [returnValueAsNSValue objCType]]; 43 | } 44 | } 45 | 46 | 47 | - (BOOL)isMethodReturnType:(const char *)returnType compatibleWithValueType:(const char *)valueType 48 | { 49 | /* Same types are obviously compatible */ 50 | if(strcmp(returnType, valueType) == 0) 51 | return YES; 52 | 53 | /* Allow void* for methods that return id, mainly to be able to handle nil */ 54 | if(strcmp(returnType, @encode(id)) == 0 && strcmp(valueType, @encode(void *)) == 0) 55 | return YES; 56 | 57 | return OCMEqualTypesAllowingOpaqueStructs(returnType, valueType); 58 | } 59 | 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | @interface OCMConstraint : NSObject 21 | 22 | + (instancetype)constraint; 23 | - (BOOL)evaluate:(id)value; 24 | 25 | // if you are looking for any, isNil, etc, they have moved to OCMArg 26 | 27 | // try to use [OCMArg checkWith...] instead of the constraintWith... methods below 28 | 29 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; 30 | + (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; 31 | 32 | 33 | @end 34 | 35 | @interface OCMAnyConstraint : OCMConstraint 36 | @end 37 | 38 | @interface OCMIsNilConstraint : OCMConstraint 39 | @end 40 | 41 | @interface OCMIsNotNilConstraint : OCMConstraint 42 | @end 43 | 44 | @interface OCMIsNotEqualConstraint : OCMConstraint 45 | { 46 | @public 47 | id testValue; 48 | } 49 | 50 | @end 51 | 52 | @interface OCMInvocationConstraint : OCMConstraint 53 | { 54 | @public 55 | NSInvocation *invocation; 56 | } 57 | 58 | @end 59 | 60 | @interface OCMBlockConstraint : OCMConstraint 61 | { 62 | BOOL (^block)(id); 63 | } 64 | 65 | - (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; 66 | 67 | @end 68 | 69 | 70 | #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] 71 | #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] 72 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMExceptionReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMReturnValueProvider.h" 18 | 19 | extern NSString *OCMStubbedException; 20 | 21 | @interface OCMExceptionReturnValueProvider : OCMReturnValueProvider 22 | { 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMExceptionReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMExceptionReturnValueProvider.h" 18 | 19 | 20 | @implementation OCMExceptionReturnValueProvider 21 | 22 | NSString *OCMStubbedException = @"OCMStubbedException"; 23 | 24 | 25 | - (void)handleInvocation:(NSInvocation *)anInvocation 26 | { 27 | [[NSException exceptionWithName:OCMStubbedException reason:@"Exception stubbed in test." userInfo:@{ @"exception": returnValue }] raise]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMExpectationRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMExpectationRecorder : OCMStubRecorder 20 | 21 | - (id)never; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMExpectationRecorder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMExpectationRecorder.h" 18 | #import "OCMInvocationExpectation.h" 19 | 20 | @implementation OCMExpectationRecorder 21 | 22 | #pragma mark Initialisers, description, accessors, etc. 23 | 24 | - (id)init 25 | { 26 | self = [super init]; 27 | [invocationMatcher release]; 28 | invocationMatcher = [[OCMInvocationExpectation alloc] init]; 29 | return self; 30 | } 31 | 32 | - (OCMInvocationExpectation *)expectation 33 | { 34 | return (OCMInvocationExpectation *)invocationMatcher; 35 | } 36 | 37 | 38 | #pragma mark Modifying the expectation 39 | 40 | - (id)never 41 | { 42 | [[self expectation] setMatchAndReject:YES]; 43 | return self; 44 | } 45 | 46 | 47 | #pragma mark Finishing recording 48 | 49 | - (void)forwardInvocation:(NSInvocation *)anInvocation 50 | { 51 | [super forwardInvocation:anInvocation]; 52 | [mockObject addExpectation:[self expectation]]; 53 | } 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMFunctions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | 20 | #if defined(__cplusplus) 21 | #define OCMOCK_EXTERN extern "C" 22 | #else 23 | #define OCMOCK_EXTERN extern 24 | #endif 25 | 26 | 27 | OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); 28 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMFunctionsPrivate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCClassMockObject; 21 | @class OCPartialMockObject; 22 | 23 | 24 | BOOL OCMIsClassType(const char *objCType); 25 | BOOL OCMIsBlockType(const char *objCType); 26 | BOOL OCMIsObjectType(const char *objCType); 27 | const char *OCMTypeWithoutQualifiers(const char *objCType); 28 | BOOL OCMEqualTypesAllowingOpaqueStructs(const char *type1, const char *type2); 29 | CFNumberType OCMNumberTypeForObjCType(const char *objcType); 30 | 31 | Class OCMCreateSubclass(Class cls, void *ref); 32 | 33 | BOOL OCMIsAliasSelector(SEL selector); 34 | SEL OCMAliasForOriginalSelector(SEL selector); 35 | SEL OCMOriginalSelectorForAlias(SEL selector); 36 | 37 | void OCMSetAssociatedMockForClass(OCClassMockObject *mock, Class aClass); 38 | OCClassMockObject *OCMGetAssociatedMockForClass(Class aClass, BOOL includeSuperclasses); 39 | 40 | void OCMSetAssociatedMockForObject(OCClassMockObject *mock, id anObject); 41 | OCPartialMockObject *OCMGetAssociatedMockForObject(id anObject); 42 | 43 | void OCMReportFailure(OCMLocation *loc, NSString *description); 44 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMIndirectReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMIndirectReturnValueProvider : NSObject 20 | { 21 | id provider; 22 | SEL selector; 23 | } 24 | 25 | - (id)initWithProvider:(id)aProvider andSelector:(SEL)aSelector; 26 | 27 | - (void)handleInvocation:(NSInvocation *)anInvocation; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMIndirectReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "NSMethodSignature+OCMAdditions.h" 18 | #import "OCMIndirectReturnValueProvider.h" 19 | #import "NSInvocation+OCMAdditions.h" 20 | 21 | 22 | @implementation OCMIndirectReturnValueProvider 23 | 24 | - (id)initWithProvider:(id)aProvider andSelector:(SEL)aSelector 25 | { 26 | if ((self = [super init])) 27 | { 28 | provider = [aProvider retain]; 29 | selector = aSelector; 30 | } 31 | 32 | return self; 33 | } 34 | 35 | - (void)dealloc 36 | { 37 | [provider release]; 38 | [super dealloc]; 39 | } 40 | 41 | - (void)handleInvocation:(NSInvocation *)anInvocation 42 | { 43 | id originalTarget = [anInvocation target]; 44 | SEL originalSelector = [anInvocation selector]; 45 | 46 | [anInvocation setTarget:provider]; 47 | [anInvocation setSelector:selector]; 48 | [anInvocation invoke]; 49 | 50 | [anInvocation setTarget:originalTarget]; 51 | [anInvocation setSelector:originalSelector]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMInvocationExpectation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMInvocationStub.h" 18 | 19 | @interface OCMInvocationExpectation : OCMInvocationStub 20 | { 21 | BOOL matchAndReject; 22 | BOOL isSatisfied; 23 | } 24 | 25 | - (void)setMatchAndReject:(BOOL)flag; 26 | - (BOOL)isMatchAndReject; 27 | 28 | - (BOOL)isSatisfied; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMInvocationExpectation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMInvocationExpectation.h" 18 | #import "NSInvocation+OCMAdditions.h" 19 | 20 | 21 | @implementation OCMInvocationExpectation 22 | 23 | - (void)setMatchAndReject:(BOOL)flag 24 | { 25 | matchAndReject = flag; 26 | if(matchAndReject) 27 | isSatisfied = YES; 28 | } 29 | 30 | - (BOOL)isMatchAndReject 31 | { 32 | return matchAndReject; 33 | } 34 | 35 | - (BOOL)isSatisfied 36 | { 37 | return isSatisfied; 38 | } 39 | 40 | - (void)handleInvocation:(NSInvocation *)anInvocation 41 | { 42 | [super handleInvocation:anInvocation]; 43 | 44 | if(matchAndReject) 45 | { 46 | isSatisfied = NO; 47 | [NSException raise:NSInternalInconsistencyException format:@"%@: explicitly disallowed method invoked: %@", 48 | [self description], [anInvocation invocationDescription]]; 49 | } 50 | else 51 | { 52 | isSatisfied = YES; 53 | } 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMInvocationMatcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMInvocationMatcher : NSObject 20 | { 21 | NSInvocation *recordedInvocation; 22 | BOOL recordedAsClassMethod; 23 | BOOL ignoreNonObjectArgs; 24 | } 25 | 26 | - (void)setInvocation:(NSInvocation *)anInvocation; 27 | - (NSInvocation *)recordedInvocation; 28 | 29 | - (void)setRecordedAsClassMethod:(BOOL)flag; 30 | - (BOOL)recordedAsClassMethod; 31 | 32 | - (void)setIgnoreNonObjectArgs:(BOOL)flag; 33 | 34 | - (BOOL)matchesSelector:(SEL)aSelector; 35 | - (BOOL)matchesInvocation:(NSInvocation *)anInvocation; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMInvocationStub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMInvocationMatcher.h" 18 | 19 | @interface OCMInvocationStub : OCMInvocationMatcher 20 | { 21 | NSMutableArray *invocationActions; 22 | } 23 | 24 | - (void)addInvocationAction:(id)anAction; 25 | - (NSArray *)invocationActions; 26 | 27 | - (void)handleInvocation:(NSInvocation *)anInvocation; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMInvocationStub.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMInvocationStub.h" 18 | #import "OCMFunctionsPrivate.h" 19 | #import "OCMArg.h" 20 | #import "OCMArgAction.h" 21 | #import "NSInvocation+OCMAdditions.h" 22 | 23 | @implementation OCMInvocationStub 24 | 25 | - (id)init 26 | { 27 | self = [super init]; 28 | invocationActions = [[NSMutableArray alloc] init]; 29 | return self; 30 | } 31 | 32 | - (void)dealloc 33 | { 34 | [invocationActions release]; 35 | [super dealloc]; 36 | } 37 | 38 | 39 | - (void)addInvocationAction:(id)anAction 40 | { 41 | [invocationActions addObject:anAction]; 42 | } 43 | 44 | - (NSArray *)invocationActions 45 | { 46 | return invocationActions; 47 | } 48 | 49 | 50 | - (void)handleInvocation:(NSInvocation *)anInvocation 51 | { 52 | NSMethodSignature *signature = [recordedInvocation methodSignature]; 53 | NSUInteger n = [signature numberOfArguments]; 54 | for(NSUInteger i = 2; i < n; i++) 55 | { 56 | id recordedArg = [recordedInvocation getArgumentAtIndexAsObject:i]; 57 | id passedArg = [anInvocation getArgumentAtIndexAsObject:i]; 58 | 59 | if([recordedArg isProxy]) 60 | continue; 61 | 62 | if([recordedArg isKindOfClass:[NSValue class]]) 63 | recordedArg = [OCMArg resolveSpecialValues:recordedArg]; 64 | 65 | if(![recordedArg isKindOfClass:[OCMArgAction class]]) 66 | continue; 67 | 68 | [recordedArg handleArgument:passedArg]; 69 | } 70 | 71 | [invocationActions makeObjectsPerformSelector:@selector(handleInvocation:) withObject:anInvocation]; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMLocation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "OCMFunctions.h" 19 | 20 | 21 | @interface OCMLocation : NSObject 22 | { 23 | id testCase; 24 | NSString *file; 25 | NSUInteger line; 26 | } 27 | 28 | + (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 29 | 30 | - (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; 31 | 32 | - (id)testCase; 33 | - (NSString *)file; 34 | - (NSUInteger)line; 35 | 36 | @end 37 | 38 | OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); 39 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMLocation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMLocation.h" 18 | 19 | @implementation OCMLocation 20 | 21 | + (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine 22 | { 23 | return [[[OCMLocation alloc] initWithTestCase:aTestCase file:aFile line:aLine] autorelease]; 24 | } 25 | 26 | - (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine 27 | { 28 | if ((self = [super init])) 29 | { 30 | testCase = aTestCase; 31 | file = [aFile retain]; 32 | line = aLine; 33 | } 34 | 35 | return self; 36 | } 37 | 38 | - (void)dealloc 39 | { 40 | [file release]; 41 | [super dealloc]; 42 | } 43 | 44 | - (id)testCase 45 | { 46 | return testCase; 47 | } 48 | 49 | - (NSString *)file 50 | { 51 | return file; 52 | } 53 | 54 | - (NSUInteger)line 55 | { 56 | return line; 57 | } 58 | 59 | @end 60 | 61 | 62 | OCMLocation *OCMMakeLocation(id testCase, const char *fileCString, int line) 63 | { 64 | return [OCMLocation locationWithTestCase:testCase file:[NSString stringWithUTF8String:fileCString] line:line]; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMMacroState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCMRecorder; 21 | @class OCMStubRecorder; 22 | @class OCMockObject; 23 | 24 | 25 | @interface OCMMacroState : NSObject 26 | { 27 | OCMRecorder *recorder; 28 | } 29 | 30 | + (void)beginStubMacro; 31 | + (OCMStubRecorder *)endStubMacro; 32 | 33 | + (void)beginExpectMacro; 34 | + (OCMStubRecorder *)endExpectMacro; 35 | 36 | + (void)beginRejectMacro; 37 | + (OCMStubRecorder *)endRejectMacro; 38 | 39 | + (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; 40 | + (void)endVerifyMacro; 41 | 42 | + (OCMMacroState *)globalState; 43 | 44 | - (OCMRecorder *)recorder; 45 | 46 | - (void)switchToClassMethod; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMNotificationPoster.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMNotificationPoster : NSObject 20 | { 21 | NSNotification *notification; 22 | } 23 | 24 | - (id)initWithNotification:(id)aNotification; 25 | 26 | - (void)handleInvocation:(NSInvocation *)anInvocation; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMNotificationPoster.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMNotificationPoster.h" 18 | 19 | 20 | @implementation OCMNotificationPoster 21 | 22 | - (id)initWithNotification:(id)aNotification 23 | { 24 | if ((self = [super init])) 25 | { 26 | notification = [aNotification retain]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (void)dealloc 33 | { 34 | [notification release]; 35 | [super dealloc]; 36 | } 37 | 38 | - (void)handleInvocation:(NSInvocation *)anInvocation 39 | { 40 | [[NSNotificationCenter defaultCenter] postNotification:notification]; 41 | } 42 | 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMObserverRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMObserverRecorder : NSObject 20 | { 21 | NSNotification *recordedNotification; 22 | } 23 | 24 | - (NSNotification *)notificationWithName:(NSString *)name object:(id)sender; 25 | 26 | - (NSNotification *)notificationWithName:(NSString *)name object:(id)sender userInfo:(NSDictionary *)userInfo; 27 | 28 | - (BOOL)matchesNotification:(NSNotification *)aNotification; 29 | 30 | - (BOOL)argument:(id)expectedArg matchesArgument:(id)observedArg; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMObserverRecorder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import 19 | #import "NSInvocation+OCMAdditions.h" 20 | #import "OCMObserverRecorder.h" 21 | 22 | @interface NSObject(HCMatcherDummy) 23 | - (BOOL)matches:(id)item; 24 | @end 25 | 26 | #pragma mark - 27 | 28 | 29 | @implementation OCMObserverRecorder 30 | 31 | #pragma mark Initialisers, description, accessors, etc. 32 | 33 | - (void)dealloc 34 | { 35 | [recordedNotification release]; 36 | [super dealloc]; 37 | } 38 | 39 | 40 | #pragma mark Recording 41 | 42 | - (NSNotification *)notificationWithName:(NSString *)name object:(id)sender 43 | { 44 | recordedNotification = [[NSNotification notificationWithName:name object:sender] retain]; 45 | return nil; 46 | } 47 | 48 | - (NSNotification *)notificationWithName:(NSString *)name object:(id)sender userInfo:(NSDictionary *)userInfo 49 | { 50 | recordedNotification = [[NSNotification notificationWithName:name object:sender userInfo:userInfo] retain]; 51 | return nil; 52 | } 53 | 54 | 55 | #pragma mark Verification 56 | 57 | - (BOOL)matchesNotification:(NSNotification *)aNotification 58 | { 59 | return [self argument:[recordedNotification name] matchesArgument:[aNotification name]] && 60 | [self argument:[recordedNotification object] matchesArgument:[aNotification object]] && 61 | [self argument:[recordedNotification userInfo] matchesArgument:[aNotification userInfo]]; 62 | } 63 | 64 | - (BOOL)argument:(id)expectedArg matchesArgument:(id)observedArg 65 | { 66 | if([expectedArg isKindOfClass:[OCMConstraint class]]) 67 | { 68 | return [expectedArg evaluate:observedArg]; 69 | } 70 | else if([expectedArg conformsToProtocol:objc_getProtocol("HCMatcher")]) 71 | { 72 | return [expectedArg matches:observedArg]; 73 | } 74 | else if (expectedArg == observedArg) 75 | { 76 | return YES; 77 | } 78 | else if (expectedArg == nil || observedArg == nil) 79 | { 80 | return NO; 81 | } 82 | else 83 | { 84 | return [expectedArg isEqual:observedArg]; 85 | } 86 | } 87 | 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMPassByRefSetter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMArgAction.h" 18 | 19 | @interface OCMPassByRefSetter : OCMArgAction 20 | { 21 | id value; 22 | } 23 | 24 | - (id)initWithValue:(id)value; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMPassByRefSetter.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMPassByRefSetter.h" 18 | 19 | 20 | @implementation OCMPassByRefSetter 21 | 22 | - (id)initWithValue:(id)aValue 23 | { 24 | if ((self = [super init])) 25 | { 26 | value = [aValue retain]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (void)dealloc 33 | { 34 | [value release]; 35 | [super dealloc]; 36 | } 37 | 38 | - (void)handleArgument:(id)arg 39 | { 40 | void *pointerValue = [arg pointerValue]; 41 | if(pointerValue != NULL) 42 | { 43 | if([value isKindOfClass:[NSValue class]]) 44 | [(NSValue *)value getValue:pointerValue]; 45 | else 46 | *(id *)pointerValue = value; 47 | } 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMRealObjectForwarder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMRealObjectForwarder : NSObject 20 | { 21 | } 22 | 23 | - (void)handleInvocation:(NSInvocation *)anInvocation; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMRealObjectForwarder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "OCPartialMockObject.h" 19 | #import "OCMRealObjectForwarder.h" 20 | #import "OCMFunctionsPrivate.h" 21 | 22 | 23 | @implementation OCMRealObjectForwarder 24 | 25 | - (void)handleInvocation:(NSInvocation *)anInvocation 26 | { 27 | id invocationTarget = [anInvocation target]; 28 | 29 | [anInvocation setSelector:OCMAliasForOriginalSelector([anInvocation selector])]; 30 | if ([invocationTarget isProxy]) 31 | { 32 | if (class_getInstanceMethod([invocationTarget mockObjectClass], @selector(realObject))) 33 | { 34 | // the method has been invoked on the mock, we need to change the target to the real object 35 | [anInvocation setTarget:[(OCPartialMockObject *)invocationTarget realObject]]; 36 | } 37 | else 38 | { 39 | [NSException raise:NSInternalInconsistencyException 40 | format:@"Method andForwardToRealObject can only be used with partial mocks and class methods."]; 41 | } 42 | } 43 | 44 | [anInvocation invoke]; 45 | } 46 | 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMockObject; 20 | @class OCMInvocationMatcher; 21 | 22 | 23 | @interface OCMRecorder : NSProxy 24 | { 25 | OCMockObject *mockObject; 26 | OCMInvocationMatcher *invocationMatcher; 27 | } 28 | 29 | - (instancetype)init; 30 | - (instancetype)initWithMockObject:(OCMockObject *)aMockObject; 31 | 32 | - (void)setMockObject:(OCMockObject *)aMockObject; 33 | 34 | - (OCMInvocationMatcher *)invocationMatcher; 35 | 36 | - (id)classMethod; 37 | - (id)ignoringNonObjectArgs; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMReturnValueProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCMReturnValueProvider : NSObject 20 | { 21 | id returnValue; 22 | } 23 | 24 | - (instancetype)initWithValue:(id)aValue; 25 | 26 | - (void)handleInvocation:(NSInvocation *)anInvocation; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMReturnValueProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "NSMethodSignature+OCMAdditions.h" 18 | #import "OCMReturnValueProvider.h" 19 | #import "OCMFunctions.h" 20 | 21 | 22 | @implementation OCMReturnValueProvider 23 | 24 | - (instancetype)initWithValue:(id)aValue 25 | { 26 | if ((self = [super init])) 27 | { 28 | returnValue = [aValue retain]; 29 | } 30 | 31 | return self; 32 | } 33 | 34 | - (void)dealloc 35 | { 36 | [returnValue release]; 37 | [super dealloc]; 38 | } 39 | 40 | - (void)handleInvocation:(NSInvocation *)anInvocation 41 | { 42 | if(!OCMIsObjectType([[anInvocation methodSignature] methodReturnType])) 43 | { 44 | @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Expected invocation with object return type. Did you mean to use andReturnValue: instead?" userInfo:nil]; 45 | } 46 | NSString *sel = NSStringFromSelector([anInvocation selector]); 47 | if([sel hasPrefix:@"alloc"] || [sel hasPrefix:@"new"] || [sel hasPrefix:@"copy"] || [sel hasPrefix:@"mutableCopy"]) 48 | { 49 | // methods that "create" an object return it with an extra retain count 50 | [returnValue retain]; 51 | } 52 | [anInvocation setReturnValue:&returnValue]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMStubRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import 19 | #import 20 | 21 | @interface OCMStubRecorder : OCMRecorder 22 | 23 | - (id)andReturn:(id)anObject; 24 | - (id)andReturnValue:(NSValue *)aValue; 25 | - (id)andThrow:(NSException *)anException; 26 | - (id)andPost:(NSNotification *)aNotification; 27 | - (id)andCall:(SEL)selector onObject:(id)anObject; 28 | - (id)andDo:(void (^)(NSInvocation *invocation))block; 29 | - (id)andForwardToRealObject; 30 | 31 | @end 32 | 33 | 34 | @interface OCMStubRecorder (Properties) 35 | 36 | #define andReturn(aValue) _andReturn(({ \ 37 | __typeof__(aValue) _val = (aValue); \ 38 | NSValue *_nsval = [NSValue value:&_val withObjCType:@encode(__typeof__(_val))]; \ 39 | if (OCMIsObjectType(@encode(__typeof(_val)))) { \ 40 | objc_setAssociatedObject(_nsval, "OCMAssociatedBoxedValue", *(__unsafe_unretained id *) (void *) &_val, OBJC_ASSOCIATION_RETAIN); \ 41 | } \ 42 | _nsval; \ 43 | })) 44 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); 45 | 46 | #define andThrow(anException) _andThrow(anException) 47 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); 48 | 49 | #define andPost(aNotification) _andPost(aNotification) 50 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); 51 | 52 | #define andCall(anObject, aSelector) _andCall(anObject, aSelector) 53 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); 54 | 55 | #define andDo(aBlock) _andDo(aBlock) 56 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); 57 | 58 | #define andForwardToRealObject() _andForwardToRealObject() 59 | @property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); 60 | 61 | @end 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMVerifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCMRecorder.h" 18 | #import "OCMLocation.h" 19 | 20 | 21 | @interface OCMVerifier : OCMRecorder 22 | 23 | @property(retain) OCMLocation *location; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMVerifier.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "OCMVerifier.h" 19 | #import "OCMockObject.h" 20 | #import "OCMLocation.h" 21 | #import "OCMInvocationMatcher.h" 22 | 23 | 24 | @implementation OCMVerifier 25 | 26 | - (id)init 27 | { 28 | if ((self = [super init])) 29 | { 30 | invocationMatcher = [[OCMInvocationMatcher alloc] init]; 31 | } 32 | 33 | return self; 34 | } 35 | 36 | - (void)forwardInvocation:(NSInvocation *)anInvocation 37 | { 38 | [super forwardInvocation:anInvocation]; 39 | [mockObject verifyInvocation:invocationMatcher atLocation:self.location]; 40 | } 41 | 42 | - (void)dealloc 43 | { 44 | [_location release]; 45 | [super dealloc]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | @class OCMInvocationStub; 21 | @class OCMStubRecorder; 22 | @class OCMInvocationMatcher; 23 | @class OCMInvocationExpectation; 24 | 25 | 26 | @interface OCMockObject : NSProxy 27 | { 28 | BOOL isNice; 29 | BOOL expectationOrderMatters; 30 | NSMutableArray *stubs; 31 | NSMutableArray *expectations; 32 | NSMutableArray *exceptions; 33 | NSMutableArray *invocations; 34 | } 35 | 36 | + (id)mockForClass:(Class)aClass; 37 | + (id)mockForProtocol:(Protocol *)aProtocol; 38 | + (id)partialMockForObject:(NSObject *)anObject; 39 | 40 | + (id)niceMockForClass:(Class)aClass; 41 | + (id)niceMockForProtocol:(Protocol *)aProtocol; 42 | 43 | + (id)observerMock; 44 | 45 | - (instancetype)init; 46 | 47 | - (void)setExpectationOrderMatters:(BOOL)flag; 48 | 49 | - (id)stub; 50 | - (id)expect; 51 | - (id)reject; 52 | 53 | - (id)verify; 54 | - (id)verifyAtLocation:(OCMLocation *)location; 55 | 56 | - (void)verifyWithDelay:(NSTimeInterval)delay; 57 | - (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; 58 | 59 | - (void)stopMocking; 60 | 61 | // internal use only 62 | 63 | - (void)addStub:(OCMInvocationStub *)aStub; 64 | - (void)addExpectation:(OCMInvocationExpectation *)anExpectation; 65 | 66 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation; 67 | - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; 68 | - (BOOL)handleSelector:(SEL)sel; 69 | 70 | - (void)verifyInvocation:(OCMInvocationMatcher *)matcher; 71 | - (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; 72 | 73 | @end 74 | 75 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCObserverMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class OCMLocation; 20 | 21 | 22 | @interface OCObserverMockObject : NSObject 23 | { 24 | BOOL expectationOrderMatters; 25 | NSMutableArray *recorders; 26 | NSMutableArray *centers; 27 | } 28 | 29 | - (void)setExpectationOrderMatters:(BOOL)flag; 30 | 31 | - (id)expect; 32 | 33 | - (void)verify; 34 | - (void)verifyAtLocation:(OCMLocation *)location; 35 | 36 | - (void)handleNotification:(NSNotification *)aNotification; 37 | 38 | // internal use 39 | 40 | - (void)autoRemoveFromCenter:(NSNotificationCenter *)aCenter; 41 | - (NSNotification *)notificationWithName:(NSString *)name object:(id)sender; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCPartialMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import "OCClassMockObject.h" 18 | 19 | @interface OCPartialMockObject : OCClassMockObject 20 | { 21 | NSObject *realObject; 22 | } 23 | 24 | - (id)initWithObject:(NSObject *)anObject; 25 | 26 | - (NSObject *)realObject; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCProtocolMockObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface OCProtocolMockObject : OCMockObject 20 | { 21 | Protocol *mockedProtocol; 22 | } 23 | 24 | - (id)initWithProtocol:(Protocol *)aProtocol; 25 | 26 | @end 27 | 28 | -------------------------------------------------------------------------------- /Pods/OCMock/Source/OCMock/OCProtocolMockObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2016 Erik Doernenburg and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use these files except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations 14 | * under the License. 15 | */ 16 | 17 | #import 18 | #import "NSMethodSignature+OCMAdditions.h" 19 | #import "OCProtocolMockObject.h" 20 | 21 | @implementation OCProtocolMockObject 22 | 23 | #pragma mark Initialisers, description, accessors, etc. 24 | 25 | - (id)initWithProtocol:(Protocol *)aProtocol 26 | { 27 | NSParameterAssert(aProtocol != nil); 28 | [super init]; 29 | mockedProtocol = aProtocol; 30 | return self; 31 | } 32 | 33 | - (NSString *)description 34 | { 35 | const char* name = protocol_getName(mockedProtocol); 36 | return [NSString stringWithFormat:@"OCMockObject(%s)", name]; 37 | } 38 | 39 | #pragma mark Proxy API 40 | 41 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector 42 | { 43 | struct { BOOL isRequired; BOOL isInstance; } opts[4] = { {YES, YES}, {NO, YES}, {YES, NO}, {NO, NO} }; 44 | for(int i = 0; i < 4; i++) 45 | { 46 | struct objc_method_description methodDescription = protocol_getMethodDescription(mockedProtocol, aSelector, opts[i].isRequired, opts[i].isInstance); 47 | if(methodDescription.name != NULL) 48 | return [NSMethodSignature signatureWithObjCTypes:methodDescription.types]; 49 | } 50 | return nil; 51 | } 52 | 53 | - (BOOL)conformsToProtocol:(Protocol *)aProtocol 54 | { 55 | return protocol_conformsToProtocol(mockedProtocol, aProtocol); 56 | } 57 | 58 | - (BOOL)respondsToSelector:(SEL)selector 59 | { 60 | return ([self methodSignatureForSelector:selector] != nil); 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Behavior.swift: -------------------------------------------------------------------------------- 1 | /** 2 | A `Behavior` encapsulates a set of examples that can be re-used in several locations using the `itBehavesLike` function with a context instance of the generic type. 3 | */ 4 | 5 | open class Behavior { 6 | 7 | open static var name: String { return String(describing: self) } 8 | /** 9 | override this method in your behavior to define a set of reusable examples. 10 | 11 | This behaves just like an example group defines using `describe` or `context`--it may contain any number of `beforeEach` 12 | and `afterEach` closures, as well as any number of examples (defined using `it`). 13 | 14 | - parameter aContext: A closure that, when evaluated, returns a `Context` instance that provide the information on the subject. 15 | */ 16 | open class func spec(_ aContext: @escaping () -> Context) {} 17 | } 18 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Callsite.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // `#if swift(>=3.2) && (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE` 4 | // does not work as expected. 5 | #if swift(>=3.2) 6 | #if (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE 7 | @objcMembers 8 | public class _CallsiteBase: NSObject {} 9 | #else 10 | public class _CallsiteBase: NSObject {} 11 | #endif 12 | #else 13 | public class _CallsiteBase: NSObject {} 14 | #endif 15 | 16 | /** 17 | An object encapsulating the file and line number at which 18 | a particular example is defined. 19 | */ 20 | final public class Callsite: _CallsiteBase { 21 | /** 22 | The absolute path of the file in which an example is defined. 23 | */ 24 | public let file: String 25 | 26 | /** 27 | The line number on which an example is defined. 28 | */ 29 | public let line: UInt 30 | 31 | internal init(file: String, line: UInt) { 32 | self.file = file 33 | self.line = line 34 | } 35 | } 36 | 37 | extension Callsite { 38 | /** 39 | Returns a boolean indicating whether two Callsite objects are equal. 40 | If two callsites are in the same file and on the same line, they must be equal. 41 | */ 42 | @nonobjc public static func == (lhs: Callsite, rhs: Callsite) -> Bool { 43 | return lhs.file == rhs.file && lhs.line == rhs.line 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/ErrorUtility.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | internal func raiseError(_ message: String) -> Never { 4 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 5 | NSException(name: .internalInconsistencyException, reason: message, userInfo: nil).raise() 6 | #endif 7 | 8 | // This won't be reached when ObjC is available and the exception above is raisd 9 | fatalError(message) 10 | } 11 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/ExampleMetadata.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // `#if swift(>=3.2) && (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE` 4 | // does not work as expected. 5 | #if swift(>=3.2) 6 | #if (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE 7 | @objcMembers 8 | public class _ExampleMetadataBase: NSObject {} 9 | #else 10 | public class _ExampleMetadataBase: NSObject {} 11 | #endif 12 | #else 13 | public class _ExampleMetadataBase: NSObject {} 14 | #endif 15 | 16 | /** 17 | A class that encapsulates information about an example, 18 | including the index at which the example was executed, as 19 | well as the example itself. 20 | */ 21 | final public class ExampleMetadata: _ExampleMetadataBase { 22 | /** 23 | The example for which this metadata was collected. 24 | */ 25 | public let example: Example 26 | 27 | /** 28 | The index at which this example was executed in the 29 | test suite. 30 | */ 31 | public let exampleIndex: Int 32 | 33 | internal init(example: Example, exampleIndex: Int) { 34 | self.example = example 35 | self.exampleIndex = exampleIndex 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Filter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // `#if swift(>=3.2) && (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE` 4 | // does not work as expected. 5 | #if swift(>=3.2) 6 | #if (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && !SWIFT_PACKAGE 7 | @objcMembers 8 | public class _FilterBase: NSObject {} 9 | #else 10 | public class _FilterBase: NSObject {} 11 | #endif 12 | #else 13 | public class _FilterBase: NSObject {} 14 | #endif 15 | 16 | /** 17 | A mapping of string keys to booleans that can be used to 18 | filter examples or example groups. For example, a "focused" 19 | example would have the flags [Focused: true]. 20 | */ 21 | public typealias FilterFlags = [String: Bool] 22 | 23 | /** 24 | A namespace for filter flag keys, defined primarily to make the 25 | keys available in Objective-C. 26 | */ 27 | final public class Filter: _FilterBase { 28 | /** 29 | Example and example groups with [Focused: true] are included in test runs, 30 | excluding all other examples without this flag. Use this to only run one or 31 | two tests that you're currently focusing on. 32 | */ 33 | public class var focused: String { 34 | return "focused" 35 | } 36 | 37 | /** 38 | Example and example groups with [Pending: true] are excluded from test runs. 39 | Use this to temporarily suspend examples that you know do not pass yet. 40 | */ 41 | public class var pending: String { 42 | return "pending" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Hooks/Closures.swift: -------------------------------------------------------------------------------- 1 | // MARK: Example Hooks 2 | 3 | /** 4 | A closure executed before an example is run. 5 | */ 6 | public typealias BeforeExampleClosure = () -> Void 7 | 8 | /** 9 | A closure executed before an example is run. The closure is given example metadata, 10 | which contains information about the example that is about to be run. 11 | */ 12 | public typealias BeforeExampleWithMetadataClosure = (_ exampleMetadata: ExampleMetadata) -> Void 13 | 14 | /** 15 | A closure executed after an example is run. 16 | */ 17 | public typealias AfterExampleClosure = BeforeExampleClosure 18 | 19 | /** 20 | A closure executed after an example is run. The closure is given example metadata, 21 | which contains information about the example that has just finished running. 22 | */ 23 | public typealias AfterExampleWithMetadataClosure = BeforeExampleWithMetadataClosure 24 | 25 | // MARK: Suite Hooks 26 | 27 | /** 28 | A closure executed before any examples are run. 29 | */ 30 | public typealias BeforeSuiteClosure = () -> Void 31 | 32 | /** 33 | A closure executed after all examples have finished running. 34 | */ 35 | public typealias AfterSuiteClosure = BeforeSuiteClosure 36 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Hooks/ExampleHooks.swift: -------------------------------------------------------------------------------- 1 | /** 2 | A container for closures to be executed before and after each example. 3 | */ 4 | final internal class ExampleHooks { 5 | internal var befores: [BeforeExampleWithMetadataClosure] = [] 6 | internal var afters: [AfterExampleWithMetadataClosure] = [] 7 | internal var phase: HooksPhase = .nothingExecuted 8 | 9 | internal func appendBefore(_ closure: @escaping BeforeExampleWithMetadataClosure) { 10 | befores.append(closure) 11 | } 12 | 13 | internal func appendBefore(_ closure: @escaping BeforeExampleClosure) { 14 | befores.append { (_: ExampleMetadata) in closure() } 15 | } 16 | 17 | internal func appendAfter(_ closure: @escaping AfterExampleWithMetadataClosure) { 18 | afters.append(closure) 19 | } 20 | 21 | internal func appendAfter(_ closure: @escaping AfterExampleClosure) { 22 | afters.append { (_: ExampleMetadata) in closure() } 23 | } 24 | 25 | internal func executeBefores(_ exampleMetadata: ExampleMetadata) { 26 | phase = .beforesExecuting 27 | for before in befores { 28 | before(exampleMetadata) 29 | } 30 | 31 | phase = .beforesFinished 32 | } 33 | 34 | internal func executeAfters(_ exampleMetadata: ExampleMetadata) { 35 | phase = .aftersExecuting 36 | for after in afters { 37 | after(exampleMetadata) 38 | } 39 | 40 | phase = .aftersFinished 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Hooks/HooksPhase.swift: -------------------------------------------------------------------------------- 1 | /** 2 | A description of the execution cycle of the current example with 3 | respect to the hooks of that example. 4 | */ 5 | internal enum HooksPhase { 6 | case nothingExecuted 7 | case beforesExecuting 8 | case beforesFinished 9 | case aftersExecuting 10 | case aftersFinished 11 | } 12 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/Hooks/SuiteHooks.swift: -------------------------------------------------------------------------------- 1 | /** 2 | A container for closures to be executed before and after all examples. 3 | */ 4 | final internal class SuiteHooks { 5 | internal var befores: [BeforeSuiteClosure] = [] 6 | internal var afters: [AfterSuiteClosure] = [] 7 | internal var phase: HooksPhase = .nothingExecuted 8 | 9 | internal func appendBefore(_ closure: @escaping BeforeSuiteClosure) { 10 | befores.append(closure) 11 | } 12 | 13 | internal func appendAfter(_ closure: @escaping AfterSuiteClosure) { 14 | afters.append(closure) 15 | } 16 | 17 | internal func executeBefores() { 18 | phase = .beforesExecuting 19 | for before in befores { 20 | before() 21 | } 22 | phase = .beforesFinished 23 | } 24 | 25 | internal func executeAfters() { 26 | phase = .aftersExecuting 27 | for after in afters { 28 | after() 29 | } 30 | phase = .aftersFinished 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/NSBundle+CurrentTestBundle.swift: -------------------------------------------------------------------------------- 1 | #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) 2 | 3 | import Foundation 4 | 5 | extension Bundle { 6 | 7 | /** 8 | Locates the first bundle with a '.xctest' file extension. 9 | */ 10 | internal static var currentTestBundle: Bundle? { 11 | return allBundles.first { $0.bundlePath.hasSuffix(".xctest") } 12 | } 13 | 14 | /** 15 | Return the module name of the bundle. 16 | Uses the bundle filename and transform it to match Xcode's transformation. 17 | Module name has to be a valid "C99 extended identifier". 18 | */ 19 | internal var moduleName: String { 20 | let fileName = bundleURL.fileName as NSString 21 | return fileName.c99ExtendedIdentifier 22 | } 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/NSString+C99ExtendedIdentifier.swift: -------------------------------------------------------------------------------- 1 | #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) 2 | import Foundation 3 | 4 | public extension NSString { 5 | 6 | private static var invalidCharacters: CharacterSet = { 7 | var invalidCharacters = CharacterSet() 8 | 9 | let invalidCharacterSets: [CharacterSet] = [ 10 | .whitespacesAndNewlines, 11 | .illegalCharacters, 12 | .controlCharacters, 13 | .punctuationCharacters, 14 | .nonBaseCharacters, 15 | .symbols 16 | ] 17 | 18 | for invalidSet in invalidCharacterSets { 19 | invalidCharacters.formUnion(invalidSet) 20 | } 21 | 22 | return invalidCharacters 23 | }() 24 | 25 | @objc(qck_c99ExtendedIdentifier) 26 | var c99ExtendedIdentifier: String { 27 | let validComponents = components(separatedBy: NSString.invalidCharacters) 28 | let result = validComponents.joined(separator: "_") 29 | 30 | return result.isEmpty ? "_" : result 31 | } 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/QuickSelectedTestSuiteBuilder.swift: -------------------------------------------------------------------------------- 1 | #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) 2 | import Foundation 3 | 4 | /** 5 | Responsible for building a "Selected tests" suite. This corresponds to a single 6 | spec, and all its examples. 7 | */ 8 | internal class QuickSelectedTestSuiteBuilder: QuickTestSuiteBuilder { 9 | 10 | /** 11 | The test spec class to run. 12 | */ 13 | let testCaseClass: AnyClass! 14 | 15 | /** 16 | For Objective-C classes, returns the class name. For Swift classes without, 17 | an explicit Objective-C name, returns a module-namespaced class name 18 | (e.g., "FooTests.FooSpec"). 19 | */ 20 | var testSuiteClassName: String { 21 | return NSStringFromClass(testCaseClass) 22 | } 23 | 24 | /** 25 | Given a test case name: 26 | 27 | FooSpec/testFoo 28 | 29 | Optionally constructs a test suite builder for the named test case class 30 | in the running test bundle. 31 | 32 | If no test bundle can be found, or the test case class can't be found, 33 | initialization fails and returns `nil`. 34 | */ 35 | init?(forTestCaseWithName name: String) { 36 | guard let testCaseClass = testCaseClassForTestCaseWithName(name) else { 37 | self.testCaseClass = nil 38 | return nil 39 | } 40 | 41 | self.testCaseClass = testCaseClass 42 | } 43 | 44 | /** 45 | Returns a `QuickTestSuite` that runs the associated test case class. 46 | */ 47 | func buildTestSuite() -> QuickTestSuite { 48 | return QuickTestSuite(forTestCaseClass: testCaseClass) 49 | } 50 | 51 | } 52 | 53 | /** 54 | Searches `Bundle.allBundles()` for an xctest bundle, then looks up the named 55 | test case class in that bundle. 56 | 57 | Returns `nil` if a bundle or test case class cannot be found. 58 | */ 59 | private func testCaseClassForTestCaseWithName(_ name: String) -> AnyClass? { 60 | func extractClassName(_ name: String) -> String? { 61 | return name.components(separatedBy: "/").first 62 | } 63 | 64 | guard let className = extractClassName(name) else { return nil } 65 | guard let bundle = Bundle.currentTestBundle else { return nil } 66 | 67 | if let testCaseClass = bundle.classNamed(className) { return testCaseClass } 68 | 69 | let moduleName = bundle.moduleName 70 | 71 | return NSClassFromString("\(moduleName).\(className)") 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/QuickTestSuite.swift: -------------------------------------------------------------------------------- 1 | #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) 2 | 3 | import XCTest 4 | 5 | /** 6 | This protocol defines the role of an object that builds test suites. 7 | */ 8 | internal protocol QuickTestSuiteBuilder { 9 | 10 | /** 11 | Construct a `QuickTestSuite` instance with the appropriate test cases added as tests. 12 | 13 | Subsequent calls to this method should return equivalent test suites. 14 | */ 15 | func buildTestSuite() -> QuickTestSuite 16 | 17 | } 18 | 19 | /** 20 | A base class for a class cluster of Quick test suites, that should correctly 21 | build dynamic test suites for XCTest to execute. 22 | */ 23 | public class QuickTestSuite: XCTestSuite { 24 | 25 | private static var builtTestSuites: Set = Set() 26 | 27 | /** 28 | Construct a test suite for a specific, selected subset of test cases (rather 29 | than the default, which as all test cases). 30 | 31 | If this method is called multiple times for the same test case class, e.g.. 32 | 33 | FooSpec/testFoo 34 | FooSpec/testBar 35 | 36 | It is expected that the first call should return a valid test suite, and 37 | all subsequent calls should return `nil`. 38 | */ 39 | @objc 40 | public static func selectedTestSuite(forTestCaseWithName name: String) -> QuickTestSuite? { 41 | guard let builder = QuickSelectedTestSuiteBuilder(forTestCaseWithName: name) else { return nil } 42 | 43 | let (inserted, _) = builtTestSuites.insert(builder.testSuiteClassName) 44 | if inserted { 45 | return builder.buildTestSuite() 46 | } else { 47 | return nil 48 | } 49 | } 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/Quick/URL+FileName.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension URL { 4 | 5 | /** 6 | Returns the path file name without file extension. 7 | */ 8 | var fileName: String { 9 | return self.deletingPathExtension().lastPathComponent 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class Configuration; 4 | 5 | /** 6 | Subclass QuickConfiguration and override the +[QuickConfiguration configure:] 7 | method in order to configure how Quick behaves when running specs, or to define 8 | shared examples that are used across spec files. 9 | */ 10 | @interface QuickConfiguration : NSObject 11 | 12 | /** 13 | This method is executed on each subclass of this class before Quick runs 14 | any examples. You may override this method on as many subclasses as you like, but 15 | there is no guarantee as to the order in which these methods are executed. 16 | 17 | You can override this method in order to: 18 | 19 | 1. Configure how Quick behaves, by modifying properties on the Configuration object. 20 | Setting the same properties in several methods has undefined behavior. 21 | 22 | 2. Define shared examples using `sharedExamples`. 23 | 24 | @param configuration A mutable object that is used to configure how Quick behaves on 25 | a framework level. For details on all the options, see the 26 | documentation in Configuration.swift. 27 | */ 28 | + (void)configure:(Configuration *)configuration; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/DSL/World+DSL.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface World (SWIFT_EXTENSION(Quick)) 4 | - (void)beforeSuite:(void (^ __nonnull)(void))closure; 5 | - (void)afterSuite:(void (^ __nonnull)(void))closure; 6 | - (void)sharedExamples:(NSString * __nonnull)name closure:(void (^ __nonnull)(NSDictionary * __nonnull (^ __nonnull)(void)))closure; 7 | - (void)describe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 8 | - (void)context:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 9 | - (void)fdescribe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 10 | - (void)xdescribe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 11 | - (void)beforeEach:(void (^ __nonnull)(void))closure; 12 | - (void)beforeEachWithMetadata:(void (^ __nonnull)(ExampleMetadata * __nonnull))closure; 13 | - (void)afterEach:(void (^ __nonnull)(void))closure; 14 | - (void)afterEachWithMetadata:(void (^ __nonnull)(ExampleMetadata * __nonnull))closure; 15 | - (void)itWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure; 16 | - (void)fitWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure; 17 | - (void)xitWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure; 18 | - (void)itBehavesLikeSharedExampleNamed:(NSString * __nonnull)name sharedExampleContext:(NSDictionary * __nonnull (^ __nonnull)(void))sharedExampleContext flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line; 19 | - (void)pending:(NSString * __nonnull)description closure:(void (^ __nonnull)(void))closure; 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/Quick.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | //! Project version number for Quick. 4 | FOUNDATION_EXPORT double QuickVersionNumber; 5 | 6 | //! Project version string for Quick. 7 | FOUNDATION_EXPORT const unsigned char QuickVersionString[]; 8 | 9 | #import "QuickSpec.h" 10 | #import "QCKDSL.h" 11 | #import "QuickConfiguration.h" 12 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/QuickSpec.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | QuickSpec is a base class all specs written in Quick inherit from. 5 | They need to inherit from QuickSpec, a subclass of XCTestCase, in 6 | order to be discovered by the XCTest framework. 7 | 8 | XCTest automatically compiles a list of XCTestCase subclasses included 9 | in the test target. It iterates over each class in that list, and creates 10 | a new instance of that class for each test method. It then creates an 11 | "invocation" to execute that test method. The invocation is an instance of 12 | NSInvocation, which represents a single message send in Objective-C. 13 | The invocation is set on the XCTestCase instance, and the test is run. 14 | 15 | Most of the code in QuickSpec is dedicated to hooking into XCTest events. 16 | First, when the spec is first loaded and before it is sent any messages, 17 | the +[NSObject initialize] method is called. QuickSpec overrides this method 18 | to call +[QuickSpec spec]. This builds the example group stacks and 19 | registers them with Quick.World, a global register of examples. 20 | 21 | Then, XCTest queries QuickSpec for a list of test methods. Normally, XCTest 22 | automatically finds all methods whose selectors begin with the string "test". 23 | However, QuickSpec overrides this default behavior by implementing the 24 | +[XCTestCase testInvocations] method. This method iterates over each example 25 | registered in Quick.World, defines a new method for that example, and 26 | returns an invocation to call that method to XCTest. Those invocations are 27 | the tests that are run by XCTest. Their selector names are displayed in 28 | the Xcode test navigation bar. 29 | */ 30 | @interface QuickSpec : XCTestCase 31 | 32 | /** 33 | Override this method in your spec to define a set of example groups 34 | and examples. 35 | 36 | @code 37 | override func spec() { 38 | describe("winter") { 39 | it("is coming") { 40 | // ... 41 | } 42 | } 43 | } 44 | @endcode 45 | 46 | See DSL.swift for more information on what syntax is available. 47 | */ 48 | - (void)spec; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/World.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class ExampleGroup; 4 | @class ExampleMetadata; 5 | 6 | SWIFT_CLASS("_TtC5Quick5World") 7 | @interface World 8 | 9 | @property (nonatomic) ExampleGroup * __nullable currentExampleGroup; 10 | @property (nonatomic) ExampleMetadata * __nullable currentExampleMetadata; 11 | @property (nonatomic) BOOL isRunningAdditionalSuites; 12 | + (World * __nonnull)sharedWorld; 13 | - (void)configure:(void (^ __nonnull)(Configuration * __nonnull))closure; 14 | - (void)finalizeConfiguration; 15 | - (ExampleGroup * __nonnull)rootExampleGroupForSpecClass:(Class __nonnull)cls; 16 | - (NSArray * __nonnull)examplesForSpecClass:(Class __nonnull)specClass; 17 | - (void)performWithCurrentExampleGroup:(ExampleGroup * __nonnull)group closure:(void (^ __nonnull)(void))closure; 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickObjectiveC/XCTestSuite+QuickTestSuiteBuilder.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | 5 | @interface XCTestSuite (QuickTestSuiteBuilder) 6 | @end 7 | 8 | @implementation XCTestSuite (QuickTestSuiteBuilder) 9 | 10 | /** 11 | In order to ensure we can correctly build dynamic test suites, we need to 12 | replace some of the default test suite constructors. 13 | */ 14 | + (void)load { 15 | Method testCaseWithName = class_getClassMethod(self, @selector(testSuiteForTestCaseWithName:)); 16 | Method hooked_testCaseWithName = class_getClassMethod(self, @selector(qck_hooked_testSuiteForTestCaseWithName:)); 17 | method_exchangeImplementations(testCaseWithName, hooked_testCaseWithName); 18 | } 19 | 20 | /** 21 | The `+testSuiteForTestCaseWithName:` method is called when a specific test case 22 | class is run from the Xcode test navigator. If the built test suite is `nil`, 23 | Xcode will not run any tests for that test case. 24 | 25 | Given if the following test case class is run from the Xcode test navigator: 26 | 27 | FooSpec 28 | testFoo 29 | testBar 30 | 31 | XCTest will invoke this once per test case, with test case names following this format: 32 | 33 | FooSpec/testFoo 34 | FooSpec/testBar 35 | */ 36 | + (nullable instancetype)qck_hooked_testSuiteForTestCaseWithName:(nonnull NSString *)name { 37 | return [QuickTestSuite selectedTestSuiteForTestCaseWithName:name]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickSpecBase/QuickSpecBase.m: -------------------------------------------------------------------------------- 1 | #import "QuickSpecBase.h" 2 | 3 | #pragma mark - _QuickSelectorWrapper 4 | 5 | @interface _QuickSelectorWrapper () 6 | @property(nonatomic, assign) SEL selector; 7 | @end 8 | 9 | @implementation _QuickSelectorWrapper 10 | 11 | - (instancetype)initWithSelector:(SEL)selector { 12 | self = [super init]; 13 | _selector = selector; 14 | return self; 15 | } 16 | 17 | @end 18 | 19 | 20 | #pragma mark - _QuickSpecBase 21 | 22 | @implementation _QuickSpecBase 23 | 24 | - (instancetype)init { 25 | self = [super initWithInvocation: nil]; 26 | return self; 27 | } 28 | 29 | /** 30 | Invocations for each test method in the test case. QuickSpec overrides this method to define a 31 | new method for each example defined in +[QuickSpec spec]. 32 | 33 | @return An array of invocations that execute the newly defined example methods. 34 | */ 35 | + (NSArray *)testInvocations { 36 | NSArray<_QuickSelectorWrapper *> *wrappers = [self _qck_testMethodSelectors]; 37 | NSMutableArray *invocations = [NSMutableArray arrayWithCapacity:wrappers.count]; 38 | 39 | for (_QuickSelectorWrapper *wrapper in wrappers) { 40 | SEL selector = wrapper.selector; 41 | NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector]; 42 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; 43 | invocation.selector = selector; 44 | 45 | [invocations addObject:invocation]; 46 | } 47 | 48 | return invocations; 49 | } 50 | 51 | + (NSArray<_QuickSelectorWrapper *> *)_qck_testMethodSelectors { 52 | return @[]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Pods/Quick/Sources/QuickSpecBase/include/QuickSpecBase.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface _QuickSelectorWrapper : NSObject 5 | - (instancetype)initWithSelector:(SEL)selector; 6 | @end 7 | 8 | @interface _QuickSpecBase : XCTestCase 9 | + (NSArray<_QuickSelectorWrapper *> *)_qck_testMethodSelectors; 10 | - (instancetype)init NS_DESIGNATED_INITIALIZER; 11 | @end 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Expecta/Expecta-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Expecta : NSObject 3 | @end 4 | @implementation PodsDummy_Expecta 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Expecta/Expecta-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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Expecta/Expecta-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 "EXPBlockDefinedMatcher.h" 14 | #import "EXPDefines.h" 15 | #import "EXPDoubleTuple.h" 16 | #import "Expecta.h" 17 | #import "ExpectaObject.h" 18 | #import "ExpectaSupport.h" 19 | #import "EXPExpect.h" 20 | #import "EXPFloatTuple.h" 21 | #import "EXPMatcher.h" 22 | #import "EXPUnsupportedObject.h" 23 | #import "EXPMatcherHelpers.h" 24 | #import "EXPMatchers+beCloseTo.h" 25 | #import "EXPMatchers+beFalsy.h" 26 | #import "EXPMatchers+beginWith.h" 27 | #import "EXPMatchers+beGreaterThan.h" 28 | #import "EXPMatchers+beGreaterThanOrEqualTo.h" 29 | #import "EXPMatchers+beIdenticalTo.h" 30 | #import "EXPMatchers+beInstanceOf.h" 31 | #import "EXPMatchers+beInTheRangeOf.h" 32 | #import "EXPMatchers+beKindOf.h" 33 | #import "EXPMatchers+beLessThan.h" 34 | #import "EXPMatchers+beLessThanOrEqualTo.h" 35 | #import "EXPMatchers+beNil.h" 36 | #import "EXPMatchers+beSubclassOf.h" 37 | #import "EXPMatchers+beSupersetOf.h" 38 | #import "EXPMatchers+beTruthy.h" 39 | #import "EXPMatchers+conformTo.h" 40 | #import "EXPMatchers+contain.h" 41 | #import "EXPMatchers+endWith.h" 42 | #import "EXPMatchers+equal.h" 43 | #import "EXPMatchers+haveCountOf.h" 44 | #import "EXPMatchers+match.h" 45 | #import "EXPMatchers+postNotification.h" 46 | #import "EXPMatchers+raise.h" 47 | #import "EXPMatchers+raiseWithReason.h" 48 | #import "EXPMatchers+respondTo.h" 49 | #import "EXPMatchers.h" 50 | #import "NSObject+Expecta.h" 51 | #import "NSValue+Expecta.h" 52 | 53 | FOUNDATION_EXPORT double ExpectaVersionNumber; 54 | FOUNDATION_EXPORT const unsigned char ExpectaVersionString[]; 55 | 56 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Expecta/Expecta.modulemap: -------------------------------------------------------------------------------- 1 | framework module Expecta { 2 | umbrella header "Expecta-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Expecta/Expecta.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Expecta 2 | ENABLE_BITCODE = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 6 | OTHER_LDFLAGS = -framework "Foundation" -framework "XCTest" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Expecta 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Expecta/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.6 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/OCMock/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 | 3.4.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/OCMock/OCMock-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_OCMock : NSObject 3 | @end 4 | @implementation PodsDummy_OCMock 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/OCMock/OCMock-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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/OCMock/OCMock-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 "OCMock.h" 14 | #import "OCMockObject.h" 15 | #import "OCMArg.h" 16 | #import "OCMConstraint.h" 17 | #import "OCMLocation.h" 18 | #import "OCMMacroState.h" 19 | #import "OCMRecorder.h" 20 | #import "OCMStubRecorder.h" 21 | #import "NSNotificationCenter+OCMAdditions.h" 22 | #import "OCMFunctions.h" 23 | 24 | FOUNDATION_EXPORT double OCMockVersionNumber; 25 | FOUNDATION_EXPORT const unsigned char OCMockVersionString[]; 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/OCMock/OCMock.modulemap: -------------------------------------------------------------------------------- 1 | framework module OCMock { 2 | umbrella header "OCMock-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/OCMock/OCMock.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/OCMock 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 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}/OCMock 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOS/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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOS/Pods-WatchCon-iOS-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOS/Pods-WatchCon-iOS-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 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOS/Pods-WatchCon-iOS-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_WatchCon_iOS : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_WatchCon_iOS 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOS/Pods-WatchCon-iOS-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_WatchCon_iOSVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_WatchCon_iOSVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOS/Pods-WatchCon-iOS.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 3 | PODS_BUILD_DIR = $BUILD_DIR 4 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOS/Pods-WatchCon-iOS.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_WatchCon_iOS { 2 | umbrella header "Pods-WatchCon-iOS-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOS/Pods-WatchCon-iOS.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 3 | PODS_BUILD_DIR = $BUILD_DIR 4 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOSTests/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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOSTests/Pods-WatchCon-iOSTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_WatchCon_iOSTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_WatchCon_iOSTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOSTests/Pods-WatchCon-iOSTests-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_WatchCon_iOSTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_WatchCon_iOSTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOSTests/Pods-WatchCon-iOSTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks "$PODS_CONFIGURATION_BUILD_DIR/Expecta" "$PODS_CONFIGURATION_BUILD_DIR/OCMock" "$PODS_CONFIGURATION_BUILD_DIR/Quick" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Expecta/Expecta.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OCMock/OCMock.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Quick/Quick.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Expecta" -framework "OCMock" -framework "Quick" 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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOSTests/Pods-WatchCon-iOSTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_WatchCon_iOSTests { 2 | umbrella header "Pods-WatchCon-iOSTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-WatchCon-iOSTests/Pods-WatchCon-iOSTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PLATFORM_DIR)/Developer/Library/Frameworks "$PODS_CONFIGURATION_BUILD_DIR/Expecta" "$PODS_CONFIGURATION_BUILD_DIR/OCMock" "$PODS_CONFIGURATION_BUILD_DIR/Quick" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Expecta/Expecta.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OCMock/OCMock.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Quick/Quick.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Expecta" -framework "OCMock" -framework "Quick" 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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/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.2.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Quick : NSObject 3 | @end 4 | @implementation PodsDummy_Quick 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick-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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick-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 "QuickConfiguration.h" 14 | #import "QCKDSL.h" 15 | #import "Quick.h" 16 | #import "QuickSpec.h" 17 | 18 | FOUNDATION_EXPORT double QuickVersionNumber; 19 | FOUNDATION_EXPORT const unsigned char QuickVersionString[]; 20 | 21 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick.modulemap: -------------------------------------------------------------------------------- 1 | framework module Quick { 2 | umbrella header "Quick-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Quick 2 | ENABLE_BITCODE = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 6 | OTHER_LDFLAGS = -framework "XCTest" 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_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Quick 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit App/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "24x24", 5 | "idiom" : "watch", 6 | "scale" : "2x", 7 | "role" : "notificationCenter", 8 | "subtype" : "38mm" 9 | }, 10 | { 11 | "size" : "27.5x27.5", 12 | "idiom" : "watch", 13 | "scale" : "2x", 14 | "role" : "notificationCenter", 15 | "subtype" : "42mm" 16 | }, 17 | { 18 | "size" : "29x29", 19 | "idiom" : "watch", 20 | "role" : "companionSettings", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "size" : "29x29", 25 | "idiom" : "watch", 26 | "role" : "companionSettings", 27 | "scale" : "3x" 28 | }, 29 | { 30 | "size" : "40x40", 31 | "idiom" : "watch", 32 | "scale" : "2x", 33 | "role" : "appLauncher", 34 | "subtype" : "38mm" 35 | }, 36 | { 37 | "size" : "86x86", 38 | "idiom" : "watch", 39 | "scale" : "2x", 40 | "role" : "quickLook", 41 | "subtype" : "38mm" 42 | }, 43 | { 44 | "size" : "98x98", 45 | "idiom" : "watch", 46 | "scale" : "2x", 47 | "role" : "quickLook", 48 | "subtype" : "42mm" 49 | } 50 | ], 51 | "info" : { 52 | "version" : 1, 53 | "author" : "xcode" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit App/Base.lproj/Interface.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | WatchOS-Sample WatchKit App 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 | CFBundleVersion 22 | 1 23 | UISupportedInterfaceOrientations 24 | 25 | UIInterfaceOrientationPortrait 26 | UIInterfaceOrientationPortraitUpsideDown 27 | 28 | WKCompanionAppBundleIdentifier 29 | com.abdullahselek.WatchOS-Sample 30 | WKWatchKitApp 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/Assets.xcassets/Complication.complicationset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets" : [ 3 | { 4 | "idiom" : "watch", 5 | "filename" : "Circular.imageset", 6 | "role" : "circular" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "filename" : "Extra Large.imageset", 11 | "role" : "extra-large" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "filename" : "Modular.imageset", 16 | "role" : "modular" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "filename" : "Utilitarian.imageset", 21 | "role" : "utilitarian" 22 | } 23 | ], 24 | "info" : { 25 | "version" : 1, 26 | "author" : "xcode" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/ExtensionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExtensionDelegate.h 3 | // WatchOS-Sample WatchKit Extension 4 | // 5 | // Created by Abdullah Selek on 11/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ExtensionDelegate : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | WatchOS-Sample WatchKit Extension 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | NSExtension 24 | 25 | NSExtensionAttributes 26 | 27 | WKAppBundleIdentifier 28 | com.abdullahselek.WatchOS-Sample.watchkitapp 29 | 30 | NSExtensionPointIdentifier 31 | com.apple.watchkit 32 | 33 | WKExtensionDelegateClassName 34 | ExtensionDelegate 35 | 36 | 37 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/InterfaceController.h: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceController.h 3 | // WatchOS-Sample WatchKit Extension 4 | // 5 | // Created by Abdullah Selek on 11/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | @interface InterfaceController : WKInterfaceController 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/InterfaceController.m: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceController.m 3 | // WatchOS-Sample WatchKit Extension 4 | // 5 | // Created by Abdullah Selek on 11/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import "InterfaceController.h" 10 | 11 | @interface InterfaceController() 12 | 13 | @property (nonatomic) WatchConSession *watchConSession; 14 | 15 | @end 16 | 17 | @implementation InterfaceController 18 | 19 | - (void)awakeWithContext:(id)context { 20 | [super awakeWithContext:context]; 21 | 22 | // Configure interface objects here. 23 | } 24 | 25 | - (void)willActivate { 26 | self.watchConSession = [WatchConSession sharedInstance]; 27 | self.watchConSession.delegate = self; 28 | [self.watchConSession activate]; 29 | [super willActivate]; 30 | } 31 | 32 | #pragma mark - WatchConSession Delegate 33 | 34 | - (void)didReceiveApplicationContext:(NSDictionary *)applicationContext { 35 | 36 | } 37 | 38 | - (void)didReceiveUserInfo:(NSDictionary *)userInfo { 39 | 40 | } 41 | 42 | - (void)didFinishFileTransfer:(WCSessionFileTransfer *)fileTransfer error:(nullable NSError *)error { 43 | 44 | } 45 | 46 | - (void)didReceiveFile:(WCSessionFile *)file { 47 | 48 | } 49 | 50 | - (void)didDeactivate { 51 | // This method is called when watch view controller is no longer visible 52 | [super didDeactivate]; 53 | } 54 | 55 | @end 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/NotificationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationController.h 3 | // WatchOS-Sample WatchKit Extension 4 | // 5 | // Created by Abdullah Selek on 11/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface NotificationController : WKUserNotificationInterfaceController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/NotificationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationController.m 3 | // WatchOS-Sample WatchKit Extension 4 | // 5 | // Created by Abdullah Selek on 11/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import "NotificationController.h" 10 | 11 | 12 | @interface NotificationController() 13 | 14 | @end 15 | 16 | 17 | @implementation NotificationController 18 | 19 | - (instancetype)init { 20 | self = [super init]; 21 | if (self){ 22 | // Initialize variables here. 23 | // Configure interface objects here. 24 | 25 | } 26 | return self; 27 | } 28 | 29 | - (void)willActivate { 30 | // This method is called when watch view controller is about to be visible to user 31 | [super willActivate]; 32 | } 33 | 34 | - (void)didDeactivate { 35 | // This method is called when watch view controller is no longer visible 36 | [super didDeactivate]; 37 | } 38 | 39 | /* 40 | - (void)didReceiveNotification:(UNNotification *)notification withCompletion:(void(^)(WKUserNotificationInterfaceType interface)) completionHandler { 41 | // This method is called when a notification needs to be presented. 42 | // Implement it if you use a dynamic notification interface. 43 | // Populate your dynamic notification interface as quickly as possible. 44 | // 45 | // After populating your dynamic notification interface call the completion block. 46 | completionHandler(WKUserNotificationInterfaceTypeCustom); 47 | } 48 | */ 49 | 50 | @end 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample WatchKit Extension/PushNotificationPayload.apns: -------------------------------------------------------------------------------- 1 | { 2 | "aps": { 3 | "alert": { 4 | "body": "Test message", 5 | "title": "Optional title" 6 | }, 7 | "category": "myCategory" 8 | }, 9 | 10 | "WatchKit Simulator Actions": [ 11 | { 12 | "title": "First Button", 13 | "identifier": "firstButtonAction" 14 | } 15 | ], 16 | 17 | "customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App." 18 | } 19 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // WatchOS-Sample 4 | // 5 | // Created by Abdullah Selek on 11/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // WatchOS-Sample 4 | // 5 | // Created by Abdullah Selek on 11/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample/Assets.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 | } -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample/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 | 27 | 28 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample/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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // WatchOS-Sample 4 | // 5 | // Created by Abdullah Selek on 11/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ViewController : UIViewController 13 | 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // WatchOS-Sample 4 | // 5 | // Created by Abdullah Selek on 11/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @property (nonatomic) WatchConSession *watchConSession; 14 | @property (weak, nonatomic) IBOutlet UITextField *messageTextField; 15 | 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | self.watchConSession = [WatchConSession sharedInstance]; 24 | self.watchConSession.delegate = self; 25 | } 26 | 27 | - (IBAction)activateWatchSession:(id)sender { 28 | [self.watchConSession activate]; 29 | } 30 | 31 | - (IBAction)sendMessage:(id)sender { 32 | if (self.messageTextField.text != nil) { 33 | [self.watchConSession sendMessage:@{@"message": self.messageTextField.text} completionBlock:^(NSDictionary * _Nullable result, NSError * _Nullable error) { 34 | if (result) { 35 | // message sent 36 | NSLog(@"%@", result); 37 | } else { 38 | // got an error 39 | NSLog(@"%@", error.localizedDescription); 40 | } 41 | }]; 42 | } 43 | } 44 | 45 | #pragma mark - WatchConSession Delegate 46 | 47 | - (void)activationDidCompleteWithState:(WCSessionActivationState)activationState 48 | error:(nullable NSError *)error{ 49 | NSLog(@"%ld", activationState); 50 | if (error) { 51 | NSLog(@"ERROR on activation : %@", error.localizedDescription); 52 | } 53 | } 54 | 55 | - (void)didReceiveApplicationContext:(NSDictionary *)applicationContext { 56 | 57 | } 58 | 59 | - (void)didReceiveUserInfo:(NSDictionary *)userInfo { 60 | 61 | } 62 | 63 | - (void)didFinishFileTransfer:(WCSessionFileTransfer *)fileTransfer error:(nullable NSError *)error { 64 | 65 | } 66 | 67 | - (void)didReceiveFile:(WCSessionFile *)file { 68 | 69 | } 70 | 71 | - (void)didReceiveMemoryWarning { 72 | [super didReceiveMemoryWarning]; 73 | // Dispose of any resources that can be recreated. 74 | } 75 | 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Sample/WatchOS-Sample/WatchOS-Sample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // WatchOS-Sample 4 | // 5 | // Created by Abdullah Selek on 11/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/Info-iOS.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 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Sources/Info-watchOS.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 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Sources/WatchCon.h: -------------------------------------------------------------------------------- 1 | // 2 | // WatchCon.h 3 | // WatchCon 4 | // 5 | // Created by Abdullah Selek on 07/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for WatchCon. 12 | FOUNDATION_EXPORT double WatchConVersionNumber; 13 | 14 | //! Project version string for WatchCon. 15 | FOUNDATION_EXPORT const unsigned char WatchConVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | #import 19 | #import 20 | 21 | -------------------------------------------------------------------------------- /Tests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/WatchConSessionTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // WatchConSessionTests.m 3 | // WatchCon 4 | // 5 | // Created by Abdullah Selek on 10/02/2017. 6 | // Copyright © 2017 Abdullah Selek. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import "WatchConSession.h" 13 | 14 | QuickSpecBegin(WatchConSessionTests) 15 | 16 | describe(@"WatchConSessionTests", ^{ 17 | context(@"-sharedInstance", ^{ 18 | it(@"should return a valid instance", ^{ 19 | WatchConSession *watchConSession = [WatchConSession sharedInstance]; 20 | expect(watchConSession).notTo.beNil(); 21 | expect([watchConSession isKindOfClass:[WatchConSession class]]).to.beTruthy(); 22 | }); 23 | }); 24 | }); 25 | 26 | 27 | QuickSpecEnd 28 | -------------------------------------------------------------------------------- /WatchCon.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = 'WatchCon' 4 | s.version = '1.0' 5 | s.summary = 'WatchCon is a tool which enables creating easy connectivity between iOS and WatchOS' 6 | s.homepage = 'https://github.com/abdullahselek/WatchCon' 7 | s.license = { 8 | :type => 'MIT', 9 | :file => 'LICENSE' 10 | } 11 | s.author = { 12 | 'Abdullah Selek' => 'abdullahselek@yahoo.com' 13 | } 14 | s.source = { 15 | :git => 'https://github.com/abdullahselek/WatchCon.git', 16 | :tag => s.version.to_s 17 | } 18 | s.ios.deployment_target = '9.0' 19 | s.watchos.deployment_target = '2.0' 20 | s.source_files = 'Sources/*.{h,m}' 21 | s.requires_arc = true 22 | s.framework = "WatchConnectivity" 23 | 24 | end -------------------------------------------------------------------------------- /WatchCon.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WatchCon.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 17 | --------------------------------------------------------------------------------