Fixed: missing protocol bug for @propety of type `id<...>` #226

Merged
merged 2 commits into from Jul 13, 2012
@@ -74,7 +74,6 @@ + (id)propertyDataWithAttributes:(NSArray *)attributes components:(NSArray *)com
nextComponentIsPropertyName = YES;
} else if ([component isEqualToString:@"id"]) {
[results addObject:component];
- nextComponentIsPropertyName = YES;
} else if ([component isMatchedByRegex:@"^[_a-zA-Z][_a-zA-Z0-9]$"]) {
if (results.count == 0 || inProtocolsList) {
[results addObject:component];
@@ -283,12 +283,12 @@ - (void)testParseObjectsFromString_shouldRegisterComplexPropertyDefinition2 {
GBObjectiveCParser *parser = [GBObjectiveCParser parserWithSettingsProvider:[GBTestObjectsRegistry mockSettingsProvider]];
GBStore *store = [[GBStore alloc] init];
// execute
- [parser parseObjectsFromString:@"@interface MyClass @property (weak) IBOutlet id delegate; @end" sourceFile:@"filename.h" toStore:store];
+ [parser parseObjectsFromString:@"@interface MyClass @property (weak) IBOutlet id<Protocol> delegate; @end" sourceFile:@"filename.h" toStore:store];
// verify
GBClassData *class = [[store classes] anyObject];
NSArray *methods = [[class methods] methods];
assertThatInteger([methods count], equalToInteger(1));
- [self assertMethod:[methods objectAtIndex:0] matchesPropertyComponents:@"weak", @"IBOutlet", @"id", @"delegate", nil];
+ [self assertMethod:[methods objectAtIndex:0] matchesPropertyComponents:@"weak", @"IBOutlet", @"id", @"<", @"Protocol", @">", @"delegate", nil];
}
- (void)testParseObjectsFromString_shouldRegisterBlockPropertyDefinition {