Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #218 from octokit/cartfile
Browse files Browse the repository at this point in the history
Use Carthage to manage submodules
  • Loading branch information
jspahrsummers committed Nov 21, 2014
2 parents 90b61d6 + eff2c04 commit 8fc0bcb
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 55 deletions.
21 changes: 15 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 5 additions & 0 deletions Cartfile.lock
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions Carthage.checkout/Mantle
Submodule Mantle added at 40abed
1 change: 1 addition & 0 deletions Carthage.checkout/Nimble
Submodule Nimble added at 81a2d8
1 change: 1 addition & 0 deletions Carthage.checkout/Quick
Submodule Quick added at 315ae2
1 change: 1 addition & 0 deletions Carthage.checkout/ReactiveCocoa
Submodule ReactiveCocoa added at 93068e
1 change: 1 addition & 0 deletions Carthage.checkout/xcconfigs
Submodule xcconfigs added at 6c7a02
1 change: 0 additions & 1 deletion External/Mantle
Submodule Mantle deleted from 9a7d85
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
D0040C7519FEBF49002869A6 /* README.md */,
);
name = Configuration;
path = ../Mantle/External/xcconfigs;
path = ../../Carthage.checkout/xcconfigs;
sourceTree = "<group>";
};
D0040C5F19FEBF49002869A6 /* Base */ = {
Expand Down
1 change: 0 additions & 1 deletion External/ReactiveCocoa
Submodule ReactiveCocoa deleted from 11a890
2 changes: 1 addition & 1 deletion OctoKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@
D0040C8D19FEBF53002869A6 /* README.md */,
);
name = Configuration;
path = External/Mantle/External/xcconfigs;
path = Carthage.checkout/xcconfigs;
sourceTree = "<group>";
};
D0040C7719FEBF53002869A6 /* Base */ = {
Expand Down
8 changes: 4 additions & 4 deletions OctoKit.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 43 additions & 41 deletions OctoKitTests/OCTObjectSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 <NSCoding>", ^{
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:obj];
expect(data).notTo(beNil());
it(@"should implement <NSCoding>", ^{
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)

Expand Down

0 comments on commit 8fc0bcb

Please sign in to comment.