Raise an assertion in the event a mapping test is invoked with a mapping containing a nil

target object class.
This commit is contained in:
Blake Watters
2012-04-02 17:15:13 -04:00
parent 73f7bf88a2
commit 1f53d45bf9

View File

@@ -156,6 +156,8 @@ BOOL RKObjectIsValueEqualToValue(id sourceValue, id destinationValue);
}
- (void)performMapping {
NSAssert(self.mapping.objectClass, @"Cannot test a mapping that does not have a destination objectClass");
// Ensure repeated invocations of verify only result in a single mapping operation
if (! self.hasPerformedMapping) {
id sourceObject = self.rootKeyPath ? [self.sourceObject valueForKeyPath:self.rootKeyPath] : self.sourceObject;