Expand test coverage and fix all known issues with managed object refetching and deletion. closes #1066

This commit is contained in:
Blake Watters
2012-12-13 22:42:34 -05:00
parent 406504ff2e
commit a424908242
4 changed files with 133 additions and 16 deletions

View File

@@ -21,6 +21,9 @@
- (id)initWithKeyPath:(NSString *)keyPath expectedValue:(id)expectedValue objectMapping:(RKObjectMapping *)objectMapping
{
NSParameterAssert(keyPath);
NSParameterAssert(expectedValue);
NSParameterAssert(objectMapping);
self = [super init];
if (self) {
self.keyPath = keyPath;
@@ -33,7 +36,9 @@
- (BOOL)matches:(id)object
{
return RKObjectIsEqualToObject([object valueForKeyPath:self.keyPath], self.expectedValue);
id value = [object valueForKeyPath:self.keyPath];
if (value == nil) return NO;
return RKObjectIsEqualToObject(value, self.expectedValue);
}
- (NSString *)description