From 614ceeb6ab4a6b1f4f42f723390e992598c8ac4b Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Fri, 21 Nov 2014 15:00:43 -0800 Subject: [PATCH 1/2] Use Carthage for managing submodules --- .gitmodules | 21 +++++++++++++------ Cartfile | 5 +++++ Cartfile.lock | 5 +++++ Carthage.checkout/Mantle | 1 + Carthage.checkout/Nimble | 1 + Carthage.checkout/Quick | 1 + Carthage.checkout/ReactiveCocoa | 1 + Carthage.checkout/xcconfigs | 1 + External/Mantle | 1 - .../project.pbxproj | 2 +- External/ReactiveCocoa | 1 - OctoKit.xcodeproj/project.pbxproj | 2 +- OctoKit.xcworkspace/contents.xcworkspacedata | 8 +++---- 13 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 Cartfile create mode 100644 Cartfile.lock create mode 160000 Carthage.checkout/Mantle create mode 160000 Carthage.checkout/Nimble create mode 160000 Carthage.checkout/Quick create mode 160000 Carthage.checkout/ReactiveCocoa create mode 160000 Carthage.checkout/xcconfigs delete mode 160000 External/Mantle delete mode 160000 External/ReactiveCocoa diff --git a/.gitmodules b/.gitmodules index 08ddb15..16d6614 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,24 @@ [submodule "External/AFNetworking"] path = External/AFNetworking url = https://github.com/github/AFNetworking.git -[submodule "External/Mantle"] - path = External/Mantle - url = https://github.com/Mantle/Mantle.git -[submodule "External/ReactiveCocoa"] - path = External/ReactiveCocoa - url = https://github.com/ReactiveCocoa/ReactiveCocoa.git [submodule "External/ISO8601DateFormatter"] path = External/ISO8601DateFormatter url = https://github.com/boredzo/iso-8601-date-formatter.git [submodule "External/OHHTTPStubs"] path = External/OHHTTPStubs url = https://github.com/github/OHHTTPStubs.git +[submodule "Carthage.checkout/Mantle"] + path = Carthage.checkout/Mantle + url = https://github.com/Mantle/Mantle.git +[submodule "Carthage.checkout/Nimble"] + path = Carthage.checkout/Nimble + url = https://github.com/Quick/Nimble.git +[submodule "Carthage.checkout/Quick"] + path = Carthage.checkout/Quick + url = https://github.com/Quick/Quick.git +[submodule "Carthage.checkout/ReactiveCocoa"] + path = Carthage.checkout/ReactiveCocoa + url = https://github.com/ReactiveCocoa/ReactiveCocoa.git +[submodule "Carthage.checkout/xcconfigs"] + path = Carthage.checkout/xcconfigs + url = https://github.com/jspahrsummers/xcconfigs.git diff --git a/Cartfile b/Cartfile new file mode 100644 index 0000000..d32f7c5 --- /dev/null +++ b/Cartfile @@ -0,0 +1,5 @@ +github "Mantle/Mantle" ~> 1.5.2 +github "ReactiveCocoa/ReactiveCocoa" ~> 2.4.1 +github "jspahrsummers/xcconfigs" >= 0.6 +github "Quick/Quick" == 0.2.0 +github "Quick/Nimble" diff --git a/Cartfile.lock b/Cartfile.lock new file mode 100644 index 0000000..dcd7401 --- /dev/null +++ b/Cartfile.lock @@ -0,0 +1,5 @@ +github "Mantle/Mantle" "1.5.2" +github "Quick/Nimble" "v0.1.0" +github "Quick/Quick" "v0.2.0" +github "ReactiveCocoa/ReactiveCocoa" "v2.4.1" +github "jspahrsummers/xcconfigs" "carthage-0.6" diff --git a/Carthage.checkout/Mantle b/Carthage.checkout/Mantle new file mode 160000 index 0000000..40abed6 --- /dev/null +++ b/Carthage.checkout/Mantle @@ -0,0 +1 @@ +Subproject commit 40abed6e58b4864afac235c3bb2552e23bc9da47 diff --git a/Carthage.checkout/Nimble b/Carthage.checkout/Nimble new file mode 160000 index 0000000..81a2d8a --- /dev/null +++ b/Carthage.checkout/Nimble @@ -0,0 +1 @@ +Subproject commit 81a2d8a63083ae6512d40f7a02d5e075e57be317 diff --git a/Carthage.checkout/Quick b/Carthage.checkout/Quick new file mode 160000 index 0000000..315ae2a --- /dev/null +++ b/Carthage.checkout/Quick @@ -0,0 +1 @@ +Subproject commit 315ae2a4a630156d5ac094ae1f107af60edce21d diff --git a/Carthage.checkout/ReactiveCocoa b/Carthage.checkout/ReactiveCocoa new file mode 160000 index 0000000..93068e3 --- /dev/null +++ b/Carthage.checkout/ReactiveCocoa @@ -0,0 +1 @@ +Subproject commit 93068e32fdc5f242fd97058f907456d5970818ad diff --git a/Carthage.checkout/xcconfigs b/Carthage.checkout/xcconfigs new file mode 160000 index 0000000..6c7a02a --- /dev/null +++ b/Carthage.checkout/xcconfigs @@ -0,0 +1 @@ +Subproject commit 6c7a02a43954c74d2be1d2fcf7bfd65a263e7c52 diff --git a/External/Mantle b/External/Mantle deleted file mode 160000 index 9a7d85a..0000000 --- a/External/Mantle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9a7d85aee16db8c7853a118c52391ec13c7bc4e1 diff --git a/External/OctoKitDependencies/OctoKitDependencies.xcodeproj/project.pbxproj b/External/OctoKitDependencies/OctoKitDependencies.xcodeproj/project.pbxproj index 896766b..e13afe7 100644 --- a/External/OctoKitDependencies/OctoKitDependencies.xcodeproj/project.pbxproj +++ b/External/OctoKitDependencies/OctoKitDependencies.xcodeproj/project.pbxproj @@ -156,7 +156,7 @@ D0040C7519FEBF49002869A6 /* README.md */, ); name = Configuration; - path = ../Mantle/External/xcconfigs; + path = ../../Carthage.checkout/xcconfigs; sourceTree = ""; }; D0040C5F19FEBF49002869A6 /* Base */ = { diff --git a/External/ReactiveCocoa b/External/ReactiveCocoa deleted file mode 160000 index 11a8902..0000000 --- a/External/ReactiveCocoa +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 11a8902857b776db15629746214a7291ea9b78d3 diff --git a/OctoKit.xcodeproj/project.pbxproj b/OctoKit.xcodeproj/project.pbxproj index 7d95190..e9cb320 100644 --- a/OctoKit.xcodeproj/project.pbxproj +++ b/OctoKit.xcodeproj/project.pbxproj @@ -761,7 +761,7 @@ D0040C8D19FEBF53002869A6 /* README.md */, ); name = Configuration; - path = External/Mantle/External/xcconfigs; + path = Carthage.checkout/xcconfigs; sourceTree = ""; }; D0040C7719FEBF53002869A6 /* Base */ = { diff --git a/OctoKit.xcworkspace/contents.xcworkspacedata b/OctoKit.xcworkspace/contents.xcworkspacedata index ff4460d..dc5c3de 100644 --- a/OctoKit.xcworkspace/contents.xcworkspacedata +++ b/OctoKit.xcworkspace/contents.xcworkspacedata @@ -5,18 +5,18 @@ location = "group:OctoKit.xcodeproj"> + location = "group:Carthage.checkout/ReactiveCocoa/ReactiveCocoa.xcodeproj"> + location = "group:Carthage.checkout/Mantle/Mantle.xcodeproj"> + location = "group:Carthage.checkout/Quick/Quick.xcodeproj"> + location = "group:Carthage.checkout/Nimble/Nimble.xcodeproj"> From eff2c04cc992b9bd1a41de0dde98e78d0789c20e Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Fri, 21 Nov 2014 15:04:01 -0800 Subject: [PATCH 2/2] Update to new Quick spec format --- OctoKitTests/OCTObjectSpec.m | 84 ++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/OctoKitTests/OCTObjectSpec.m b/OctoKitTests/OCTObjectSpec.m index ad9c3f5..2269231 100644 --- a/OctoKitTests/OCTObjectSpec.m +++ b/OctoKitTests/OCTObjectSpec.m @@ -18,62 +18,64 @@ NSString * const OCTObjectKey = @"object"; NSString * const OCTObjectExternalRepresentationKey = @"externalRepresentation"; -QuickSharedExampleGroupsBegin(OCTObjectSharedExamples) +QuickConfigurationBegin(OCTObjectSharedExamples) -sharedExamples(OCTObjectArchivingSharedExamplesName, ^(QCKDSLSharedExampleContext data) { - __block OCTObject *obj; ++ (void)configure:(Configuration *)configuration { + sharedExamples(OCTObjectArchivingSharedExamplesName, ^(QCKDSLSharedExampleContext data) { + __block OCTObject *obj; - beforeEach(^{ - obj = data()[OCTObjectKey]; - expect(obj).notTo(beNil()); - }); + beforeEach(^{ + obj = data()[OCTObjectKey]; + expect(obj).notTo(beNil()); + }); - it(@"should implement ", ^{ - NSData *data = [NSKeyedArchiver archivedDataWithRootObject:obj]; - expect(data).notTo(beNil()); + it(@"should implement ", ^{ + NSData *data = [NSKeyedArchiver archivedDataWithRootObject:obj]; + expect(data).notTo(beNil()); - OCTObject *unarchivedObj = [NSKeyedUnarchiver unarchiveObjectWithData:data]; - expect(unarchivedObj).to(equal(obj)); + OCTObject *unarchivedObj = [NSKeyedUnarchiver unarchiveObjectWithData:data]; + expect(unarchivedObj).to(equal(obj)); + }); }); -}); -sharedExamples(OCTObjectExternalRepresentationSharedExamplesName, ^(QCKDSLSharedExampleContext data) { - __block OCTObject *obj; - __block NSDictionary *representation; + sharedExamples(OCTObjectExternalRepresentationSharedExamplesName, ^(QCKDSLSharedExampleContext data) { + __block OCTObject *obj; + __block NSDictionary *representation; - __block void (^expectRepresentationsToMatch)(NSDictionary *, NSDictionary *); + __block void (^expectRepresentationsToMatch)(NSDictionary *, NSDictionary *); - beforeEach(^{ - obj = data()[OCTObjectKey]; - expect(obj).notTo(beNil()); + beforeEach(^{ + obj = data()[OCTObjectKey]; + expect(obj).notTo(beNil()); - representation = data()[OCTObjectExternalRepresentationKey]; - expect(representation).notTo(beNil()); + representation = data()[OCTObjectExternalRepresentationKey]; + expect(representation).notTo(beNil()); - __block void (^expectRepresentationsToMatchRecur)(NSDictionary *, NSDictionary *); - expectRepresentationsToMatch = ^(NSDictionary *representation, NSDictionary *JSONDictionary) { - [representation enumerateKeysAndObjectsUsingBlock:^(NSString *key, id expectedValue, BOOL *stop) { - id value = JSONDictionary[key]; - if (value == nil) return; + __block void (^expectRepresentationsToMatchRecur)(NSDictionary *, NSDictionary *); + expectRepresentationsToMatch = ^(NSDictionary *representation, NSDictionary *JSONDictionary) { + [representation enumerateKeysAndObjectsUsingBlock:^(NSString *key, id expectedValue, BOOL *stop) { + id value = JSONDictionary[key]; + if (value == nil) return; - if ([value isKindOfClass:NSDictionary.class]) { - expectRepresentationsToMatchRecur(value, expectedValue); - } else { - expect(value).to(equal(expectedValue)); - } - }]; - }; + if ([value isKindOfClass:NSDictionary.class]) { + expectRepresentationsToMatchRecur(value, expectedValue); + } else { + expect(value).to(equal(expectedValue)); + } + }]; + }; - expectRepresentationsToMatchRecur = expectRepresentationsToMatch; - }); + expectRepresentationsToMatchRecur = expectRepresentationsToMatch; + }); - it(@"should be equal in all values that exist in both external representations", ^{ - NSDictionary *JSONDictionary = [MTLJSONAdapter JSONDictionaryFromModel:obj]; - expectRepresentationsToMatch(representation, JSONDictionary); + it(@"should be equal in all values that exist in both external representations", ^{ + NSDictionary *JSONDictionary = [MTLJSONAdapter JSONDictionaryFromModel:obj]; + expectRepresentationsToMatch(representation, JSONDictionary); + }); }); -}); +} -QuickSharedExampleGroupsEnd +QuickConfigurationEnd QuickSpecBegin(OCTObjectSpec)