Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #124 from ikesyo/master

Fix spec description
  • Loading branch information...
commit 864aba4a01201efd0d1691675f4f38b8dc7a4ca0 2 parents c469c2d + 97f4cbd
Allen Ding authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 Kiwi/KWSpec.m
7 Kiwi/KWSpec.m
View
@@ -64,10 +64,9 @@ - (NSString *)description
name = [name stringByReplacingOccurrencesOfString:@"," withString:@"_"];
// Strip out characters not legal in function names
- NSMutableCharacterSet *illegalCharacters = [NSMutableCharacterSet alphanumericCharacterSet];
- [illegalCharacters addCharactersInString:@"_()"];
- [illegalCharacters invert];
- name = [[name componentsSeparatedByCharactersInSet:illegalCharacters] componentsJoinedByString:@""];
+ NSError *error = nil;
+ NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"[^a-zA-Z0-9_]*" options:0 error:&error];
+ name = [regex stringByReplacingMatchesInString:name options:0 range:NSMakeRange(0, name.length) withTemplate:@""];
return [NSString stringWithFormat:@"-[%@ %@]", NSStringFromClass([self class]), name];
}
Please sign in to comment.
Something went wrong with that request. Please try again.