Break out reused functions for object mapping introspection into RKObjectUtilities

This commit is contained in:
Blake Watters
2012-09-30 12:49:59 -04:00
parent 03439f2464
commit d95fe5cd44
8 changed files with 179 additions and 72 deletions

View File

@@ -23,6 +23,7 @@
#import "RKObjectMappingOperationDataSource.h"
#import "RKRelationshipMapping.h"
#import "RKErrors.h"
#import "RKObjectUtilities.h"
// Error Constants
NSString * const RKMappingTestErrorDomain = @"org.restkit.RKMappingTest.ErrorDomain";
@@ -31,8 +32,6 @@ NSString * const RKMappingTestExpectationErrorKey = @"RKMappingTestExpectationEr
NSString * const RKMappingTestValueErrorKey = @"RKMappingTestValueErrorKey";
NSString * const RKMappingTestVerificationFailureException = @"RKMappingTestVerificationFailureException";
BOOL RKValueIsEqualToValue(id sourceValue, id destinationValue);
///-----------------------------------------------------------------------------
///-----------------------------------------------------------------------------
@@ -217,7 +216,7 @@ BOOL RKValueIsEqualToValue(id sourceValue, id destinationValue);
}
} else if (expectation.value) {
// Use RestKit comparison magic to match values
success = RKValueIsEqualToValue(event.value, expectation.value);
success = RKObjectIsEqualToObject(event.value, expectation.value);
if (! success) {
NSString *description = [NSString stringWithFormat:@"mapped to unexpected %@ value '%@'", [event.value class], event.value];