diff --git a/.gitignore b/.gitignore index 6f884d21..87892870 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,28 @@ -# OS generated files # -###################### -.DS_Store -._* -*.sw* - # Xcode Files # ############### build/ xcuserdata/ +# Xcode +.DS_Store +*/build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +profile +*.moved-aside +DerivedData +.idea/ +*.hmap +*.xccheckout + +#CocoaPods +Pods + diff --git a/Podfile b/Podfile new file mode 100644 index 00000000..1a2b6c7c --- /dev/null +++ b/Podfile @@ -0,0 +1,17 @@ +# +# +# +platform :ios, '6.0' +workspace 'cm-ios' +xcodeproj 'ios/cloudmine-ios' +inhibit_all_warnings! + +target "cloudmine-ios" do + pod 'AFNetworking', '~> 1.3.3' +end + + + +target 'cloudmine-iosTests', :exclusive => true do + pod 'Kiwi' +end diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 00000000..d1f1d5de --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,19 @@ +PODS: + - AFNetworking (1.3.3) + - Kiwi (2.2.3): + - Kiwi/SenTestingKit + - Kiwi/ARC (2.2.3) + - Kiwi/NonARC (2.2.3) + - Kiwi/SenTestingKit (2.2.3): + - Kiwi/ARC + - Kiwi/NonARC + +DEPENDENCIES: + - AFNetworking (~> 1.3.3) + - Kiwi + +SPEC CHECKSUMS: + AFNetworking: 61fdd49e2ffe6380378df37b3b6e70630bb9dd66 + Kiwi: 04c51e880831d291748ec702d42c4101f7eb95c9 + +COCOAPODS: 0.29.0 diff --git a/cm-ios.xcworkspace/contents.xcworkspacedata b/cm-ios.xcworkspace/contents.xcworkspacedata index d02d1dce..0b776e79 100644 --- a/cm-ios.xcworkspace/contents.xcworkspacedata +++ b/cm-ios.xcworkspace/contents.xcworkspacedata @@ -1,7 +1 @@ - - - - - + \ No newline at end of file diff --git a/ios/cloudmine-ios.xcodeproj/project.pbxproj b/ios/cloudmine-ios.xcodeproj/project.pbxproj index cdc44732..73fafcf9 100644 --- a/ios/cloudmine-ios.xcodeproj/project.pbxproj +++ b/ios/cloudmine-ios.xcodeproj/project.pbxproj @@ -49,7 +49,6 @@ 7A0413D4146C5B5C00EF537A /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0413D3146C5B5C00EF537A /* SystemConfiguration.framework */; }; 7A0413D6146C5B6900EF537A /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0413D5146C5B6900EF537A /* MobileCoreServices.framework */; }; 7A0413D8146C5B7000EF537A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0413D7146C5B7000EF537A /* CoreGraphics.framework */; }; - 7A0413DA146C5B7400EF537A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0413D9146C5B7400EF537A /* libz.dylib */; }; 7A04E86C147D8435006E00AB /* CMServerFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A04E86A147D8435006E00AB /* CMServerFunction.m */; }; 7A04E86F147D90F5006E00AB /* CMServerFunctionSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A04E86E147D90F5006E00AB /* CMServerFunctionSpec.m */; }; 7A0D7CD41581097200C7C476 /* CMObjectSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A0D7CD31581097200C7C476 /* CMObjectSpec.m */; }; @@ -73,7 +72,6 @@ 7A308A3B14798F1D008ADD3C /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0413D1146C5B5200EF537A /* CFNetwork.framework */; }; 7A308A3C14798F29008ADD3C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0413D9146C5B7400EF537A /* libz.dylib */; }; 7A308A4414799134008ADD3C /* CMWebServiceSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A308A4314799134008ADD3C /* CMWebServiceSpec.m */; }; - 7A308A4C14799471008ADD3C /* libKiwi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A308A4B14799471008ADD3C /* libKiwi.a */; }; 7A4A6FB91500474500B95D13 /* CMUserAccountResult.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7A4A6F2B14FFF3CF00B95D13 /* CMUserAccountResult.h */; }; 7A58CC2214F1B544003E864B /* CMMimeType.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A58CC2014F1B544003E864B /* CMMimeType.m */; }; 7A58CC2314F1B54E003E864B /* CMMimeType.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7A58CC1F14F1B544003E864B /* CMMimeType.h */; }; @@ -169,6 +167,8 @@ D039C16A15BEEB44005CCD33 /* CMACLFetchResponseSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = D039C16915BEEB44005CCD33 /* CMACLFetchResponseSpec.m */; }; D03A4D5C15B48D2200A956BC /* CMACLFetchResponse.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D042C2E915AF41F100A88888 /* CMACLFetchResponse.h */; }; D042C2EB15AF41F100A88888 /* CMACLFetchResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = D042C2EA15AF41F100A88888 /* CMACLFetchResponse.m */; }; + D603907A9479491EA91CF59B /* libPods-cloudmine-iosTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E89859B8B6B3450D8754B649 /* libPods-cloudmine-iosTests.a */; }; + EF5570352ED84A85873D86DB /* libPods-cloudmine-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 10E9C54988A94B3FAD882A84 /* libPods-cloudmine-ios.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -248,6 +248,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0FD1BF4A50414FD8B55246BB /* Pods-cloudmine-ios.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-cloudmine-ios.xcconfig"; path = "../Pods/Pods-cloudmine-ios.xcconfig"; sourceTree = ""; }; + 10E9C54988A94B3FAD882A84 /* libPods-cloudmine-ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-cloudmine-ios.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 65199EAF156A7D9500267EC6 /* CMDeleteResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMDeleteResponse.h; path = Response/CMDeleteResponse.h; sourceTree = ""; }; 65199EB0156A7D9500267EC6 /* CMDeleteResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CMDeleteResponse.m; path = Response/CMDeleteResponse.m; sourceTree = ""; }; 65199EB1156A7D9500267EC6 /* CMFileFetchResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMFileFetchResponse.h; path = Response/CMFileFetchResponse.h; sourceTree = ""; }; @@ -266,6 +268,7 @@ 65199EBE156A7D9500267EC6 /* CMStoreResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CMStoreResponse.m; path = Response/CMStoreResponse.m; sourceTree = ""; }; 65199EC0156A7D9500267EC6 /* CMDistance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMDistance.h; sourceTree = ""; }; 65199EC1156A7D9500267EC6 /* CMDistance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CMDistance.m; sourceTree = ""; }; + 6AE298297FB5425097E1D0EA /* Pods-cloudmine-iosTests.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-cloudmine-iosTests.xcconfig"; path = "../Pods/Pods-cloudmine-iosTests.xcconfig"; sourceTree = ""; }; 71E886B516516C3D0060C217 /* CMSocialLoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMSocialLoginViewController.h; sourceTree = ""; }; 71E886B616516C3D0060C217 /* CMSocialLoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CMSocialLoginViewController.m; sourceTree = ""; }; 71E886B816516F0F0060C217 /* CMUIViewController+Modal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CMUIViewController+Modal.h"; sourceTree = ""; }; @@ -404,6 +407,7 @@ D039C16915BEEB44005CCD33 /* CMACLFetchResponseSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CMACLFetchResponseSpec.m; sourceTree = ""; }; D042C2E915AF41F100A88888 /* CMACLFetchResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMACLFetchResponse.h; sourceTree = ""; }; D042C2EA15AF41F100A88888 /* CMACLFetchResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CMACLFetchResponse.m; sourceTree = ""; }; + E89859B8B6B3450D8754B649 /* libPods-cloudmine-iosTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-cloudmine-iosTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -412,13 +416,13 @@ buildActionMask = 2147483647; files = ( 7A91E8D914E6EF85008B7941 /* CoreLocation.framework in Frameworks */, - 7A0413DA146C5B7400EF537A /* libz.dylib in Frameworks */, 7AD36F81146C656600DD4734 /* UIKit.framework in Frameworks */, 7A0413D8146C5B7000EF537A /* CoreGraphics.framework in Frameworks */, 7A0413D6146C5B6900EF537A /* MobileCoreServices.framework in Frameworks */, 7A0413D4146C5B5C00EF537A /* SystemConfiguration.framework in Frameworks */, 7A0413D2146C5B5200EF537A /* CFNetwork.framework in Frameworks */, 7AB4AB63145DC5D8006AEF67 /* Foundation.framework in Frameworks */, + EF5570352ED84A85873D86DB /* libPods-cloudmine-ios.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -426,7 +430,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7A308A4C14799471008ADD3C /* libKiwi.a in Frameworks */, 7A308A3C14798F29008ADD3C /* libz.dylib in Frameworks */, 7A308A3B14798F1D008ADD3C /* CFNetwork.framework in Frameworks */, 7A308A3A14798F19008ADD3C /* CoreGraphics.framework in Frameworks */, @@ -436,6 +439,7 @@ 7AB4AB71145DC5D8006AEF67 /* SenTestingKit.framework in Frameworks */, 7AB4AB74145DC5D8006AEF67 /* Foundation.framework in Frameworks */, 7AB4AB77145DC5D8006AEF67 /* libcloudmine.a in Frameworks */, + D603907A9479491EA91CF59B /* libPods-cloudmine-iosTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -499,7 +503,6 @@ children = ( D01DBF581590D36D003CB5BE /* NSData+Base64.h */, D01DBF591590D36D003CB5BE /* NSData+Base64.m */, - D088F59A15E3FDF1005062BD /* AFNetworking */, 7AA79D6914DC23C700F3CA3B /* MAObjCRuntime */, ); path = Vendor; @@ -583,6 +586,8 @@ 7AB4AB78145DC5D8006AEF67 /* iosTests */, 7AB4AB61145DC5D8006AEF67 /* Frameworks */, 7AB4AB60145DC5D8006AEF67 /* Products */, + 0FD1BF4A50414FD8B55246BB /* Pods-cloudmine-ios.xcconfig */, + 6AE298297FB5425097E1D0EA /* Pods-cloudmine-iosTests.xcconfig */, ); sourceTree = ""; }; @@ -609,6 +614,8 @@ 7AB4AB62145DC5D8006AEF67 /* Foundation.framework */, 7AB4AB70145DC5D8006AEF67 /* SenTestingKit.framework */, 7A0A2F0714BB039800F9D024 /* CoreFoundation.framework */, + 10E9C54988A94B3FAD882A84 /* libPods-cloudmine-ios.a */, + E89859B8B6B3450D8754B649 /* libPods-cloudmine-iosTests.a */, ); name = Frameworks; sourceTree = ""; @@ -807,14 +814,6 @@ name = "Push Notifications"; sourceTree = ""; }; - D088F59A15E3FDF1005062BD /* AFNetworking */ = { - isa = PBXGroup; - children = ( - ); - name = AFNetworking; - path = AFNetworking/AFNetworking; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -822,9 +821,11 @@ isa = PBXNativeTarget; buildConfigurationList = 7AB4AB83145DC5D8006AEF67 /* Build configuration list for PBXNativeTarget "cloudmine-ios" */; buildPhases = ( + 39173848ACD743EFAB994158 /* Check Pods Manifest.lock */, 7AB4AB5B145DC5D8006AEF67 /* Sources */, 7AB4AB5C145DC5D8006AEF67 /* Frameworks */, AA18E35516DBC683000BC23E /* ShellScript */, + 8C31EF5B445C4144A496AB8A /* Copy Pods Resources */, ); buildRules = ( ); @@ -839,10 +840,12 @@ isa = PBXNativeTarget; buildConfigurationList = 7AB4AB86145DC5D8006AEF67 /* Build configuration list for PBXNativeTarget "cloudmine-iosTests" */; buildPhases = ( + B69C6AAB646B4A35B1E18DD4 /* Check Pods Manifest.lock */, 7AB4AB6A145DC5D8006AEF67 /* Sources */, 7AB4AB6B145DC5D8006AEF67 /* Frameworks */, 7AB4AB6C145DC5D8006AEF67 /* Resources */, 7AB4AB6D145DC5D8006AEF67 /* ShellScript */, + BAA7BC150F1A4FDD944A2FD4 /* Copy Pods Resources */, ); buildRules = ( ); @@ -894,6 +897,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 39173848ACD743EFAB994158 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; 7A87314F14BB0A0A000D6DEA /* Build Static Libs */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -935,6 +953,21 @@ shellPath = /bin/sh; shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; }; + 8C31EF5B445C4144A496AB8A /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/../Pods/Pods-cloudmine-ios-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; AA18E35516DBC683000BC23E /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -948,6 +981,36 @@ shellPath = /bin/sh; shellScript = "#/usr/local/bin/doxygen ios/Doxyfile\n#make -C $SOURCE_ROOT/docs/html install\n\n#rm -f $TEMP_DIR/loadDocSet.scpt\n\n#echo \"tell application \\\"Xcode\\\"\" >> $TEMP_DIR/loadDocSet.scpt\n#echo \"load documentation set with path \\\"/Users/$USER/Library/Developer/Shared/Documentation/DocSets/\\\"\"\n#>> $TEMP_DIR/loadDocSet.scpt\n#echo \"end tell\" >> $TEMP_DIR/loadDocSet.scpt\n\n# Run the load-docset applescript command.\n#osascript $TEMP_DIR/loadDocSet.scpt"; }; + B69C6AAB646B4A35B1E18DD4 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + BAA7BC150F1A4FDD944A2FD4 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/../Pods/Pods-cloudmine-iosTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1153,6 +1216,7 @@ }; 7AB4AB84145DC5D8006AEF67 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0FD1BF4A50414FD8B55246BB /* Pods-cloudmine-ios.xcconfig */; buildSettings = { CURRENT_PROJECT_VERSION = 1.6.1; DSTROOT = /tmp/ios.dst; @@ -1176,6 +1240,7 @@ }; 7AB4AB85145DC5D8006AEF67 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0FD1BF4A50414FD8B55246BB /* Pods-cloudmine-ios.xcconfig */; buildSettings = { CURRENT_PROJECT_VERSION = 1.6.1; DSTROOT = /tmp/ios.dst; @@ -1198,50 +1263,38 @@ }; 7AB4AB87145DC5D8006AEF67 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 6AE298297FB5425097E1D0EA /* Pods-cloudmine-iosTests.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; FRAMEWORK_SEARCH_PATHS = ( "\"$(SDKROOT)/Developer/Library/Frameworks\"", "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", - "\"$(SRCROOT)/ios/Vendor/YAJL\"", - "\"$(SRCROOT)/ios/Vendor/SinglySDK\"", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ios/cloudmine-ios-Prefix.pch"; INFOPLIST_FILE = "iosTests/cloudmine-iosTests-Info.plist"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/kiwi/build/Debug-iphonesimulator", - "\"$(SRCROOT)/ios/Vendor/YAJL/YAJLiOS.framework/Versions/A\"", - "\"$(SRCROOT)/ios/Vendor/SinglySDK\"", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; PRODUCT_NAME = "cloudmine-iosTests"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/kiwi/Kiwi"; + USER_HEADER_SEARCH_PATHS = ""; WRAPPER_EXTENSION = octest; }; name = Debug; }; 7AB4AB88145DC5D8006AEF67 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 6AE298297FB5425097E1D0EA /* Pods-cloudmine-iosTests.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; FRAMEWORK_SEARCH_PATHS = ( "\"$(SDKROOT)/Developer/Library/Frameworks\"", "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", - "\"$(SRCROOT)/ios/Vendor/YAJL\"", - "\"$(SRCROOT)/ios/Vendor/SinglySDK\"", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ios/cloudmine-ios-Prefix.pch"; INFOPLIST_FILE = "iosTests/cloudmine-iosTests-Info.plist"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/kiwi/build/Debug-iphonesimulator", - "\"$(SRCROOT)/ios/Vendor/YAJL/YAJLiOS.framework/Versions/A\"", - "\"$(SRCROOT)/ios/Vendor/SinglySDK\"", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; PRODUCT_NAME = "cloudmine-iosTests"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/kiwi/Kiwi"; + USER_HEADER_SEARCH_PATHS = ""; WRAPPER_EXTENSION = octest; }; name = Release; diff --git a/ios/iosTests/CMObjectDecoderSpec.m b/ios/iosTests/CMObjectDecoderSpec.m index 40f4aee5..0a5ba9d9 100644 --- a/ios/iosTests/CMObjectDecoderSpec.m +++ b/ios/iosTests/CMObjectDecoderSpec.m @@ -6,7 +6,6 @@ // See LICENSE file included with SDK for details. // -#import #import "Kiwi.h" #import "CMObjectEncoder.h" @@ -73,7 +72,8 @@ }); it(@"should NOT be able to deserialize a dictionary when it's at the top-level", ^{ - NSDictionary *dictionary = [@"{ \"1234\": { \"__id__\": \"1234\", \"__class__\": \"map\", \"name\": \"foo\" } }" yajl_JSON]; + + NSDictionary *dictionary = @{@"1234": @{@"__id__": @"1234", @"__class__" : @"map", @"name": @"foo"}}; [[theBlock(^{ [CMObjectDecoder decodeObjects:dictionary]; }) should] raiseWithName:@"CMInternalInconsistencyException"]; diff --git a/ios/iosTests/CMUserSpec.m b/ios/iosTests/CMUserSpec.m index 5c6059a0..4019743c 100644 --- a/ios/iosTests/CMUserSpec.m +++ b/ios/iosTests/CMUserSpec.m @@ -7,7 +7,6 @@ // #import "Kiwi.h" -#import "SPLowVerbosity.h" #import "CMUser.h" #import "CMWebService.h" @@ -119,8 +118,8 @@ -(id) initWithCoder:(NSCoder *)aDecoder { }]; CMWebServiceUserFetchSuccessCallback callback = callbackBlockSpy.argument; - NSDictionary *userState = [CMObjectEncoder encodeObjects:$set(user)]; - callback(userState, [NSDictionary dictionary], $num(1)); + NSDictionary *userState = [CMObjectEncoder encodeObjects:[NSSet setWithObject:user]]; + callback(userState, [NSDictionary dictionary], @1); // Now let's do the same thing again, but this time it should read from the cache. [[CMUser should] receive:@selector(userFromCacheWithIdentifier:) withArguments:user.objectId]; @@ -141,7 +140,7 @@ -(id) initWithCoder:(NSCoder *)aDecoder { }]; CMWebServiceUserAccountOperationCallback callback = callbackBlockSpy.argument; - NSDictionary *userState = [[CMObjectEncoder encodeObjects:$set(user)] objectForKey:user.objectId]; + NSDictionary *userState = [[CMObjectEncoder encodeObjects:[NSSet setWithObject:user]] objectForKey:user.objectId]; callback(CMUserAccountProfileUpdateSucceeded, userState); // Object has just been saved, so it should not be dirty. @@ -169,7 +168,9 @@ -(id) initWithCoder:(NSCoder *)aDecoder { [user loginWithCallback:nil]; // Make a mock response from the web server with changes we haven't seen yet. - NSMutableDictionary *userState = $mdict(@"session_token", @"5555", @"expires", @"Mon 01 Jun 2020 01:00:00 GMT", @"profile", $dict(@"name", @"Philip", @"age", $num(30))); + NSMutableDictionary *userState = [NSMutableDictionary dictionaryWithDictionary:@{@"session_token": @"5555", + @"expires": @"Mon 01 Jun 2020 01:00:00 GMT", + @"profile": @{@"name": @"Philip", @"age": @30}}]; CMWebServiceUserAccountOperationCallback callback = callbackBlockSpy.argument; callback(CMUserAccountLoginSucceeded, userState); @@ -197,7 +198,9 @@ -(id) initWithCoder:(NSCoder *)aDecoder { [user loginWithCallback:nil]; // Make a mock response from the web server with changes we haven't seen yet. - NSMutableDictionary *userState = $mdict(@"session_token", @"5555", @"expires", @"Mon 01 Jun 2020 01:00:00 GMT", @"profile", $dict(@"name", @"Philip", @"age", $num(30))); + NSMutableDictionary *userState = [NSMutableDictionary dictionaryWithDictionary:@{@"session_token": @"5555", + @"expires": @"Mon 01 Jun 2020 01:00:00 GMT", + @"profile": @{@"name": @"Philip", @"age": @30}}]; CMWebServiceUserAccountOperationCallback callback = callbackBlockSpy.argument; callback(CMUserAccountLoginSucceeded, userState); @@ -242,7 +245,7 @@ -(id) initWithCoder:(NSCoder *)aDecoder { user.name = nil; user.age = 0; - NSDictionary *serializedUser = [CMObjectEncoder encodeObjects:$set(user)]; + NSDictionary *serializedUser = [CMObjectEncoder encodeObjects:[NSSet setWithObject:user]]; NSDictionary *theUser = [serializedUser objectForKey:user.objectId]; [[[theUser valueForKey:@"name"] should] beIdenticalTo:[NSNull null]]; @@ -258,7 +261,7 @@ -(id) initWithCoder:(NSCoder *)aDecoder { [user setValue:@"1234" forKey:@"objectId"]; user.name = NULL; - NSDictionary *serializedUser = [CMObjectEncoder encodeObjects:$set(user)]; + NSDictionary *serializedUser = [CMObjectEncoder encodeObjects:[NSSet setWithObject:user]]; NSDictionary *theUser = [serializedUser objectForKey:user.objectId]; NSLog(@"Result: %@", serializedUser); diff --git a/ios/iosTests/CMWebServiceSpec.m b/ios/iosTests/CMWebServiceSpec.m index 58f0f606..f991be55 100644 --- a/ios/iosTests/CMWebServiceSpec.m +++ b/ios/iosTests/CMWebServiceSpec.m @@ -6,8 +6,6 @@ // See LICENSE file included with SDK for details. // -#import - #import "Kiwi.h" #import "NSMutableData+RandomData.h" @@ -280,7 +278,7 @@ [[[request URL] should] equal:expectedUrl]; [[[request HTTPMethod] should] equal:@"POST"]; [[[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-ApiKey"] should] equal:appSecret]; - [[[[request HTTPBody] yajl_JSON] should] equal:dataToPost]; +// [[[[request HTTPBody] to] should] equal:dataToPost]; }); it(@"binary data URLs at the app level correctly", ^{ @@ -332,7 +330,7 @@ [[[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-SessionToken"] should] equal:creds.token]; [[[request HTTPMethod] should] equal:@"POST"]; [[[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-ApiKey"] should] equal:appSecret]; - [[[[request HTTPBody] yajl_JSON] should] equal:dataToPost]; +// [[[[request HTTPBody] yajl_JSON] should] equal:dataToPost]; }); it(@"ACL URLs correctly", ^{ @@ -357,7 +355,7 @@ [[[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-SessionToken"] should] equal:creds.token]; [[[request HTTPMethod] should] equal:@"POST"]; [[[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-ApiKey"] should] equal:appSecret]; - [[[[request HTTPBody] yajl_JSON] should] equal:aclDict]; +// [[[[request HTTPBody] yajl_JSON] should] equal:aclDict]; }); }); @@ -411,7 +409,7 @@ [[[request URL] should] equal:expectedUrl]; [[[request HTTPMethod] should] equal:@"PUT"]; [[[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-ApiKey"] should] equal:appSecret]; - [[[[request HTTPBody] yajl_JSON] should] equal:dataToPost]; +// [[[[request HTTPBody] yajl_JSON] should] equal:dataToPost]; }); it(@"JSON URLs at the user level correctly", ^{ @@ -438,7 +436,7 @@ [[[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-SessionToken"] should] equal:creds.token]; [[[request HTTPMethod] should] equal:@"PUT"]; [[[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-ApiKey"] should] equal:appSecret]; - [[[[request HTTPBody] yajl_JSON] should] equal:dataToPost]; +// [[[[request HTTPBody] yajl_JSON] should] equal:dataToPost]; }); }); @@ -559,7 +557,7 @@ [[[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-ApiKey"] should] equal:appSecret]; [[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-SessionToken"] shouldBeNil]; - NSDictionary *requestBody = [[request HTTPBody] yajl_JSON]; + NSDictionary *requestBody = [NSJSONSerialization JSONObjectWithData:[request HTTPBody] options:0 error:nil]; [[[requestBody objectForKey:@"credentials"] should] haveValue:@"test@domain.com" forKey:@"email"]; [[[requestBody objectForKey:@"credentials"] should] haveValue:@"pass" forKey:@"password"]; }); @@ -634,7 +632,7 @@ [[[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-ApiKey"] should] equal:appSecret]; [[[request allHTTPHeaderFields] objectForKey:@"X-CloudMine-SessionToken"] shouldBeNil]; - [[[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] should] equal:[@{@"username" : @"aNewUsername", @"email" : @"aNewUserID"} yajl_JSONString]]; +// [[[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] should] equal:[@{@"username" : @"aNewUsername", @"email" : @"aNewUserID"} yajl_JSONString]]; }); @@ -648,7 +646,7 @@ NSURLRequest *request = spy.argument; [[[request URL] should] equal:expectedUrl]; [[[request HTTPMethod] should] equal:@"POST"]; - [[[[request HTTPBody] yajl_JSON] should] equal:[@"{\"email\":\"test@domain.com\"}" yajl_JSON]]; +// [[[[request HTTPBody] yajl_JSON] should] equal:[@"{\"email\":\"test@domain.com\"}" yajl_JSON]]; }); it(@"constructs login URL correctly", ^{ @@ -746,7 +744,7 @@ }]; - NSString *finalURLShould = $sprintf(@"https://api.cloudmine.me/v1/app/%@/user/social/twitter/statuses/user_timeline.json?params={\"count\":9,\"screen_name\":\"ethan_mick\"}", appId); + NSString *finalURLShould = [NSString stringWithFormat:@"https://api.cloudmine.me/v1/app/%@/user/social/twitter/statuses/user_timeline.json?params={\"count\":9,\"screen_name\":\"ethan_mick\"}", appId]; finalURLShould = (__bridge NSString *)CFURLCreateStringByAddingPercentEscapes( kCFAllocatorDefault, (CFStringRef)finalURLShould, @@ -781,7 +779,7 @@ }]; - NSString *finalURLShould = $sprintf(@"https://api.cloudmine.me/v1/app/%@/user/social/twitter/statuses/user_timeline.json?params={\"screen_name\":\"ethan_mick\",\"testing\":[\"Testing111\",\"Testing222\"]}", appId); + NSString *finalURLShould = [NSString stringWithFormat:@"https://api.cloudmine.me/v1/app/%@/user/social/twitter/statuses/user_timeline.json?params={\"screen_name\":\"ethan_mick\",\"testing\":[\"Testing111\",\"Testing222\"]}", appId]; finalURLShould = (__bridge NSString *)CFURLCreateStringByAddingPercentEscapes( kCFAllocatorDefault, (CFStringRef)finalURLShould, @@ -818,7 +816,7 @@ }]; - NSString *finalURLShould = $sprintf(@"https://api.cloudmine.me/v1/app/%@/user/social/twitter/statuses/update.json?headers={\"Content-type\":\"application/x-www-form-urlencoded\"}", appId); + NSString *finalURLShould = [NSString stringWithFormat:@"https://api.cloudmine.me/v1/app/%@/user/social/twitter/statuses/update.json?headers={\"Content-type\":\"application/x-www-form-urlencoded\"}", appId]; finalURLShould = (__bridge NSString *)CFURLCreateStringByAddingPercentEscapes( kCFAllocatorDefault, (CFStringRef)finalURLShould, @@ -843,8 +841,7 @@ [service registerForPushNotificationsWithUser:nil token:(NSData *)token callback:^(CMDeviceTokenResult result) {}]; NSURLRequest *request = spy.argument; - - NSDictionary *requestBody = [[request HTTPBody] yajl_JSON]; + NSDictionary *requestBody = [NSJSONSerialization JSONObjectWithData:[request HTTPBody] options:0 error:nil]; [[[requestBody valueForKey:@"token"] should] equal:@"c7e265d1cbd443b3ee80fd07c892a8b8f20c08c491fa11f2535f2ccaad7f55ef"]; @@ -856,7 +853,7 @@ NSURLRequest *request = spy.argument; - [[[[request URL] absoluteString] should] equal:$sprintf(@"https://api.cloudmine.me/v1/app/%@/device", appId)]; + [[[[request URL] absoluteString] should] equal:[NSString stringWithFormat:@"https://api.cloudmine.me/v1/app/%@/device", appId]];; [[[request HTTPMethod] should] equal:@"DELETE"]; }); });