Skip to content

Commit

Permalink
Override test models' -description methods
Browse files Browse the repository at this point in the history
Prevents infinite looping in Nimble matchers, which apparently pull out
a description eagerly.
  • Loading branch information
jspahrsummers committed Oct 21, 2014
1 parent 5dc5dfa commit 08ba09c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions MantleTests/MTLCoreDataTestModels.m
Expand Up @@ -40,6 +40,10 @@ + (NSDictionary *)relationshipModelClassesByPropertyKey {
};
}

- (NSString *)description {
return [NSString stringWithFormat:@"<%@: %p>", self.class, self];
}

@end

@implementation MTLParentMergingTestModel
Expand All @@ -62,6 +66,10 @@ + (NSDictionary *)managedObjectKeysByPropertyKey {
return @{};
}

- (NSString *)description {
return [NSString stringWithFormat:@"<%@: %p>", self.class, self];
}

@end

@implementation MTLChildTestModel
Expand All @@ -85,6 +93,10 @@ + (NSDictionary *)relationshipModelClassesByPropertyKey {
};
}

- (NSString *)description {
return [NSString stringWithFormat:@"<%@: %p>", self.class, self];
}

@end

@implementation MTLBadChildTestModel
Expand All @@ -101,6 +113,9 @@ + (NSSet *)propertyKeysForManagedObjectUniquing {
return [NSSet setWithObjects:@"childID", nil];
}

- (NSString *)description {
return [NSString stringWithFormat:@"<%@: %p>", self.class, self];
}

@end

Expand All @@ -114,6 +129,10 @@ + (NSString *)managedObjectEntityName {
return @"Empty";
}

- (NSString *)description {
return [NSString stringWithFormat:@"<%@: %p>", self.class, self];
}

@end

@implementation MTLIllegalManagedObjectMappingModel
Expand All @@ -128,4 +147,8 @@ + (NSDictionary *)managedObjectKeysByPropertyKey {
};
}

- (NSString *)description {
return [NSString stringWithFormat:@"<%@: %p>", self.class, self];
}

@end

0 comments on commit 08ba09c

Please sign in to comment.