mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 20:31:13 +08:00
Port a few test cases to Expecta syntax
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
withPrimaryKeyAttribute:mapping.primaryKeyAttribute
|
||||
value:[NSNumber numberWithInt:123456]
|
||||
inManagedObjectContext:managedObjectStore.persistentStoreManagedObjectContext];
|
||||
assertThat(cachedObject, is(equalTo(reginald)));
|
||||
expect(cachedObject).to.equal(reginald);
|
||||
}
|
||||
|
||||
- (void)testFetchRequestMappingCacheReturnsObjectsWithStringPrimaryKey
|
||||
@@ -54,7 +54,7 @@
|
||||
withPrimaryKeyAttribute:mapping.primaryKeyAttribute
|
||||
value:@"e-1234-a8-b12"
|
||||
inManagedObjectContext:managedObjectStore.persistentStoreManagedObjectContext];
|
||||
assertThat(cachedObject, is(equalTo(birthday)));
|
||||
expect(cachedObject).to.equal(birthday);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
{
|
||||
RKSearchTokenizer *stringTokenizer = [RKSearchTokenizer new];
|
||||
NSSet *tokens = [stringTokenizer tokenize:@"This is a test"];
|
||||
assertThat(tokens, is(equalTo([NSSet setWithArray:@[ @"this", @"is", @"a", @"test" ]])));
|
||||
NSSet *expectedTokens = [NSSet setWithArray:@[ @"this", @"is", @"a", @"test" ]];
|
||||
expect(tokens).to.equal(expectedTokens);
|
||||
}
|
||||
|
||||
- (void)testTokenizingStringWithStopWords
|
||||
@@ -27,7 +28,8 @@
|
||||
RKSearchTokenizer *stringTokenizer = [RKSearchTokenizer new];
|
||||
stringTokenizer.stopWords = [NSSet setWithObjects:@"is", @"a", nil];
|
||||
NSSet *tokens = [stringTokenizer tokenize:@"This is a test"];
|
||||
assertThat(tokens, is(equalTo([NSSet setWithArray:@[ @"this", @"test" ]])));
|
||||
NSSet *expectedTokens = [NSSet setWithArray:@[ @"this", @"test" ]];
|
||||
expect(tokens).to.equal(expectedTokens);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user