Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates to add passing feature file defining how basic cucumber shoul…
…d work. also fixes issue where tables and text attached to steps weren't passed through on a step that had no regex arguments
- Loading branch information
David Siebecker
committed
Jul 26, 2016
1 parent
1769e81
commit 29b001d
Showing
11 changed files
with
755 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// NSArray+Hashes.h | ||
// CucumberishExample | ||
// | ||
// Created by David Siebecker on 7/26/16. | ||
// Copyright © 2016 Ahmed Ali. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface NSArray (Hashes) | ||
/** | ||
* Converts an NSArray<NSArray> to an array of dictionaries where the keys for the dictionary are the elements in the first array in self | ||
* @return the row hashes | ||
*/ | ||
-(NSArray*)rowHashes; | ||
|
||
/** | ||
* Converts an NSArray<NSArray> to an array of dictionaries where the kesy for the dictionary are the first elements in each array in self | ||
* @return the column hashes | ||
*/ | ||
-(NSArray*)columnHashes; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// NSArray+Hashes.m | ||
// CucumberishExample | ||
// | ||
// Created by David Siebecker on 7/26/16. | ||
// Copyright © 2016 Ahmed Ali. All rights reserved. | ||
// | ||
|
||
#import "NSArray+Hashes.h" | ||
|
||
@implementation NSArray (Hashes) | ||
|
||
-(NSArray *)rowHashes | ||
{ | ||
NSMutableArray *array = [NSMutableArray arrayWithCapacity:self.count]; | ||
NSArray *keys = self[0]; | ||
for (NSInteger i = 1; i < self.count; i++) { | ||
NSMutableDictionary *dict = [NSMutableDictionary dictionary]; | ||
NSArray *values = self[i]; | ||
[keys enumerateObjectsUsingBlock:^(NSString * _Nonnull key, NSUInteger idx, BOOL * _Nonnull stop) { | ||
dict[key] = values[idx]; | ||
}]; | ||
[array addObject:dict]; | ||
} | ||
return array; | ||
} | ||
|
||
-(NSArray *)columnHashes | ||
{ | ||
NSMutableArray *array = [NSMutableArray arrayWithCapacity:[self[0] count]-1]; | ||
NSArray *keys = [self valueForKey:@"firstObject"]; | ||
for (NSInteger i = 0; i < keys.count; i++) { | ||
NSMutableDictionary *dict = [NSMutableDictionary dictionary]; | ||
[self enumerateObjectsUsingBlock:^(NSString * _Nonnull key, NSUInteger idx, BOOL * _Nonnull stop) { | ||
if (idx != 0) { | ||
dict[key] = self[i][idx]; | ||
} | ||
}]; | ||
[array addObject:dict]; | ||
} | ||
return array; | ||
} | ||
|
||
@end |
Oops, something went wrong.