Add better description output to RKMappingTest

This commit is contained in:
Blake Watters
2012-06-07 11:10:01 -04:00
parent 1c504022a6
commit ec1e15d4e3

View File

@@ -68,7 +68,8 @@ BOOL RKObjectIsValueEqualToValue(id sourceValue, id destinationValue);
- (NSString *)description
{
return [NSString stringWithFormat:@"%@: mapped sourceKeyPath '%@' => destinationKeyPath '%@' with value: %@", [self class], self.sourceKeyPath, self.destinationKeyPath, self.value];
return [NSString stringWithFormat:@"%@ mapped sourceKeyPath '%@' => destinationKeyPath '%@' with value: %@>", [self class],
self.sourceKeyPath, self.destinationKeyPath, self.value];
}
@end
@@ -228,6 +229,22 @@ BOOL RKObjectIsValueEqualToValue(id sourceValue, id destinationValue);
}
}
- (NSString *)expectationsDescription
{
return [self.expectations valueForKey:@"description"];
}
- (NSString *)eventsDescription
{
return [self.events valueForKey:@"description"];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@ Expectations: %@\nEvents: %@",
[self class], [self expectationsDescription], [self eventsDescription]];
}
#pragma mark - RKObjecMappingOperationDelegate
- (void)addEvent:(RKMappingTestEvent *)event