mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 04:20:21 +08:00
Expand test coverage and fix all known issues with managed object refetching and deletion. closes #1066
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user