Skip to content

Commit

Permalink
Merge pull request #120 from Mazyod/develop
Browse files Browse the repository at this point in the history
Resolve individual case runs with non-pretty names
  • Loading branch information
Ahmed-Ali authored Sep 8, 2021
2 parents 0de5c3d + 869ef1d commit 022084f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Cucumberish/Cucumberish.m
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,11 @@ + (nullable XCTestCase *)cucumberish_testCaseWithSelector:(SEL)selector

for(CCIScenarioDefinition * s in feature.scenarioDefinitions){
NSString * scenarioName = NSStringFromSelector(selector);
if ([s.name isEqualToString:scenarioName]){
NSString * comparedName = s.name;
if(![[Cucumberish instance] prettyNamesAllowed] && ![[Cucumberish instance] prettyScenarioNamesAllowed]){
comparedName = [comparedName camleCaseStringWithFirstUppercaseCharacter:NO];
}
if ([comparedName isEqualToString:scenarioName]){
[Cucumberish instance].scenarioCount++;
NSInvocation * inv = [Cucumberish invocationForScenario:s feature:feature featureClass:[self class]];
invocationTest = [[XCTestCase alloc] initWithInvocation:inv];
Expand All @@ -493,6 +497,9 @@ + (nullable XCTestCase *)cucumberish_testCaseWithSelector:(SEL)selector
NSRange range = [scenarioName rangeOfCharacterFromSet:[NSCharacterSet decimalDigitCharacterSet] options:NSBackwardsSearch];
NSInteger exampleIndex = [[scenarioName substringWithRange:range] integerValue] - 1;
NSString * scenarioOutlineName = [Cucumberish exampleScenarioNameForScenarioName:s.name exampleAtIndex:exampleIndex example:s.examples.firstObject];
if(![[Cucumberish instance] prettyNamesAllowed] && ![[Cucumberish instance] prettyScenarioNamesAllowed]){
scenarioOutlineName = [scenarioOutlineName camleCaseStringWithFirstUppercaseCharacter:NO];
}
if([scenarioName isEqualToString:scenarioOutlineName]){
CCIExample * example = s.examples.firstObject;
NSInvocation * inv = [Cucumberish invocationForScenarioOutline:s example:example exampleIndex:exampleIndex feature:feature featureClass:[self class]];
Expand Down

0 comments on commit 022084f

Please sign in to comment.