xcfit 2.0.6 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/.swift-version +1 -0
  3. data/.travis.yml +13 -13
  4. data/README.md +57 -35
  5. data/XCFit.podspec +6 -16
  6. data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift +14 -12
  7. data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift +16 -15
  8. data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift +11 -11
  9. data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift +5 -5
  10. data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift +9 -8
  11. data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift +7 -6
  12. data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +7 -5
  13. data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +10 -8
  14. data/homebrew/xcfit +155 -0
  15. data/lib/XCFit/version.rb +1 -1
  16. metadata +15 -177
  17. data/XCFit/Classes/.gitkeep +0 -0
  18. data/XCFit/Classes/CliSwift.swift +0 -87
  19. data/XCFit/Classes/CopyDir.swift +0 -26
  20. data/XCFit/Classes/Cucumberish/Core/CCIBlockDefinitions.h +0 -400
  21. data/XCFit/Classes/Cucumberish/Core/Managers/CCIFeaturesManager.h +0 -72
  22. data/XCFit/Classes/Cucumberish/Core/Managers/CCIFeaturesManager.m +0 -141
  23. data/XCFit/Classes/Cucumberish/Core/Managers/CCIStepsManager.h +0 -51
  24. data/XCFit/Classes/Cucumberish/Core/Managers/CCIStepsManager.m +0 -245
  25. data/XCFit/Classes/Cucumberish/Core/Models/CCIArgument.h +0 -62
  26. data/XCFit/Classes/Cucumberish/Core/Models/CCIArgument.m +0 -117
  27. data/XCFit/Classes/Cucumberish/Core/Models/CCIAroundHock.h +0 -37
  28. data/XCFit/Classes/Cucumberish/Core/Models/CCIAroundHock.m +0 -37
  29. data/XCFit/Classes/Cucumberish/Core/Models/CCIBackground.h +0 -46
  30. data/XCFit/Classes/Cucumberish/Core/Models/CCIBackground.m +0 -117
  31. data/XCFit/Classes/Cucumberish/Core/Models/CCIExample.h +0 -89
  32. data/XCFit/Classes/Cucumberish/Core/Models/CCIExample.m +0 -128
  33. data/XCFit/Classes/Cucumberish/Core/Models/CCIFeature.h +0 -49
  34. data/XCFit/Classes/Cucumberish/Core/Models/CCIFeature.m +0 -174
  35. data/XCFit/Classes/Cucumberish/Core/Models/CCIHock.h +0 -36
  36. data/XCFit/Classes/Cucumberish/Core/Models/CCIHock.m +0 -34
  37. data/XCFit/Classes/Cucumberish/Core/Models/CCILocation.h +0 -61
  38. data/XCFit/Classes/Cucumberish/Core/Models/CCILocation.m +0 -91
  39. data/XCFit/Classes/Cucumberish/Core/Models/CCIScenarioDefinition.h +0 -97
  40. data/XCFit/Classes/Cucumberish/Core/Models/CCIScenarioDefinition.m +0 -224
  41. data/XCFit/Classes/Cucumberish/Core/Models/CCIStep.h +0 -85
  42. data/XCFit/Classes/Cucumberish/Core/Models/CCIStep.m +0 -98
  43. data/XCFit/Classes/Cucumberish/Core/Models/CCIStepDefinition.h +0 -43
  44. data/XCFit/Classes/Cucumberish/Core/Models/CCIStepDefinition.m +0 -65
  45. data/XCFit/Classes/Cucumberish/Cucumberish.h +0 -133
  46. data/XCFit/Classes/Cucumberish/Cucumberish.m +0 -604
  47. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstBuilder.h +0 -15
  48. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstBuilder.m +0 -312
  49. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstNode.h +0 -20
  50. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstNode.m +0 -79
  51. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHBackground.h +0 -12
  52. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHBackground.m +0 -18
  53. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHComment.h +0 -11
  54. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHComment.m +0 -27
  55. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDataTable.h +0 -14
  56. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDataTable.m +0 -30
  57. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDocString.h +0 -14
  58. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDocString.m +0 -29
  59. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHExamples.h +0 -24
  60. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHExamples.m +0 -49
  61. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHFeature.h +0 -24
  62. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHFeature.m +0 -50
  63. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialect.h +0 -25
  64. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialect.m +0 -64
  65. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProvider.h +0 -9
  66. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProvider.m +0 -124
  67. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProviderProtocol.h +0 -10
  68. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageConstants.h +0 -9
  69. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageConstants.m +0 -10
  70. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageSetting.h +0 -17
  71. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageSetting.m +0 -18
  72. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLine.h +0 -12
  73. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLine.m +0 -179
  74. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineProtocol.h +0 -64
  75. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineSpan.h +0 -9
  76. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineSpan.m +0 -26
  77. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasDescriptionProtocol.h +0 -8
  78. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasLocationProtocol.h +0 -8
  79. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasRowsProtocol.h +0 -8
  80. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasStepsProtocol.h +0 -8
  81. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasTagsProtocol.h +0 -8
  82. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHLocation.h +0 -12
  83. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHLocation.m +0 -41
  84. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHNode.h +0 -4
  85. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHNode.m +0 -5
  86. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser+Extensions.h +0 -10
  87. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser+Extensions.m +0 -18
  88. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser.h +0 -132
  89. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser.m +0 -2735
  90. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParserException.h +0 -55
  91. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParserException.m +0 -192
  92. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenario.h +0 -14
  93. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenario.m +0 -18
  94. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition.h +0 -23
  95. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition.m +0 -41
  96. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition_Private.h +0 -6
  97. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioOutline.h +0 -15
  98. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioOutline.m +0 -26
  99. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStep.h +0 -16
  100. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStep.m +0 -35
  101. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStepArgument.h +0 -4
  102. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStepArgument.m +0 -5
  103. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableCell.h +0 -13
  104. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableCell.m +0 -28
  105. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableRow.h +0 -13
  106. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableRow.m +0 -29
  107. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTag.h +0 -13
  108. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTag.m +0 -28
  109. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHToken.h +0 -26
  110. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHToken.m +0 -50
  111. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenMatcher.h +0 -29
  112. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenMatcher.m +0 -283
  113. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenScanner.h +0 -12
  114. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenScanner.m +0 -59
  115. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/NSString+Trim.h +0 -7
  116. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/NSString+Trim.m +0 -28
  117. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/gherkin-languages.json +0 -2969
  118. data/XCFit/Classes/Cucumberish/Utils/NSArray+Hashes.h +0 -24
  119. data/XCFit/Classes/Cucumberish/Utils/NSArray+Hashes.m +0 -44
  120. data/XCFit/Classes/Cucumberish/Utils/NSObject+Dictionary.h +0 -7
  121. data/XCFit/Classes/Cucumberish/Utils/NSObject+Dictionary.m +0 -83
  122. data/XCFit/Classes/Cucumberish/Utils/NSString+Formatter.h +0 -32
  123. data/XCFit/Classes/Cucumberish/Utils/NSString+Formatter.m +0 -70
  124. data/XCFit_Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
  125. data/XCFit_Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -40
  126. data/XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/Empty.xib +0 -12
  127. data/XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateIcon.icns +0 -0
  128. data/XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist +0 -61
  129. data/XCFit_Templates/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
  130. data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
  131. data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -134
  132. data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -17
  133. data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +0 -13
  134. data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___POD_NAME___.m +0 -25
  135. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/AcceptanceTests-Bridging-Header.h +0 -1
  136. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/FixtureExample.swift +0 -35
  137. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/SlimTables.h +0 -28
  138. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/TemplateInfo.plist +0 -155
  139. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +0 -12
  140. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -33
  141. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift +0 -41
  142. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift +0 -92
  143. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift +0 -58
  144. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift +0 -24
  145. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift +0 -28
  146. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift +0 -26
  147. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
  148. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
  149. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateInfo.plist +0 -159
  150. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +0 -15
  151. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.h +0 -23
  152. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -28
  153. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +0 -37
  154. data/Xcode7-Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
  155. data/Xcode7-Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -40
  156. data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/Empty.xib +0 -12
  157. data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateIcon.icns +0 -0
  158. data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist +0 -61
  159. data/Xcode7-Templates/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
  160. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/BaseScreen.swift +0 -42
  161. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/Extensions.swift +0 -60
  162. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeElements.swift +0 -31
  163. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeProtocol.swift +0 -25
  164. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreen.swift +0 -24
  165. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreenTest.swift +0 -30
  166. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/ProtocolOrientedTest.swift +0 -45
  167. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
  168. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
  169. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateInfo.plist +0 -141
  170. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___TestBase.swift +0 -30
  171. data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon-old.icns +0 -0
  172. data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon.png +0 -0
  173. data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon@2x.png +0 -0
  174. data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -40
  175. data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon-old.icns +0 -0
  176. data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon.png +0 -0
  177. data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon@2x.png +0 -0
  178. data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateInfo.plist +0 -59
  179. data/Xcode7-Templates/XCFit/iOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
  180. data/Xcode7-Templates/XCFit/iOS XCUI POM Test Bundle.xctemplate/TemplateInfo.plist +0 -39
@@ -1,11 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "GHHasLocationProtocol.h"
3
-
4
- @interface GHComment : NSObject <GHHasLocationProtocol>
5
-
6
- @property (nonatomic, readonly) GHLocation * location;
7
- @property (nonatomic, readonly) NSString * text;
8
-
9
- - (id)initWithLocation:(GHLocation *)theLocation text:(NSString *)theText;
10
-
11
- @end
@@ -1,27 +0,0 @@
1
- #import "GHComment.h"
2
-
3
- @interface GHComment ()
4
-
5
- @property (nonatomic, strong) GHLocation * location;
6
- @property (nonatomic, strong) NSString * text;
7
-
8
- @end
9
-
10
- @implementation GHComment
11
-
12
- @synthesize location;
13
- @synthesize text;
14
-
15
- - (id)initWithLocation:(GHLocation *)theLocation text:(NSString *)theText
16
- {
17
- if (self = [super init])
18
- {
19
- location = theLocation;
20
- text = theText;
21
-
22
- }
23
-
24
- return self;
25
- }
26
-
27
- @end
@@ -1,14 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "GHStepArgument.h"
3
-
4
- #import "GHHasRowsProtocol.h"
5
- #import "GHHasLocationProtocol.h"
6
-
7
- @interface GHDataTable : GHStepArgument <GHHasLocationProtocol, GHHasLocationProtocol>
8
-
9
- @property (nonatomic, readonly) GHLocation * location;
10
- @property (nonatomic, readonly) NSArray<GHTableRow *> * rows;
11
-
12
- - (id)initWithTableRows:(NSArray<GHTableRow *> *)theRows;
13
-
14
- @end
@@ -1,30 +0,0 @@
1
- #import "GHDataTable.h"
2
-
3
- #import "GHTableRow.h"
4
-
5
- @interface GHDataTable ()
6
-
7
- @property (nonatomic, strong) GHLocation * location;
8
- @property (nonatomic, strong) NSArray<GHTableRow *> * rows;
9
-
10
- @end
11
-
12
- @implementation GHDataTable
13
-
14
- @synthesize location;
15
- @synthesize rows;
16
-
17
- - (id)initWithTableRows:(NSArray<GHTableRow *> *)theRows
18
- {
19
- NSAssert([theRows count], @"Rows argument cannot not be nil or empty");
20
-
21
- if (self = [super init])
22
- {
23
- rows = theRows;
24
- location = [[rows firstObject] location];
25
- }
26
-
27
- return self;
28
- }
29
-
30
- @end
@@ -1,14 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "GHStepArgument.h"
3
-
4
- #import "GHHasLocationProtocol.h"
5
-
6
- @interface GHDocString : GHStepArgument <GHHasLocationProtocol>
7
-
8
- @property (nonatomic, readonly) GHLocation * location;
9
- @property (nonatomic, readonly) NSString * contentType;
10
- @property (nonatomic, readonly) NSString * content;
11
-
12
- - (id)initWithLocation:(GHLocation *)theLocation contentType:(NSString *)theContentType content:(NSString *)theContent;
13
-
14
- @end
@@ -1,29 +0,0 @@
1
- #import "GHDocString.h"
2
-
3
- @interface GHDocString ()
4
-
5
- @property (nonatomic, strong) GHLocation * location;
6
- @property (nonatomic, strong) NSString * contentType;
7
- @property (nonatomic, strong) NSString * content;
8
-
9
- @end
10
-
11
- @implementation GHDocString
12
-
13
- @synthesize location;
14
- @synthesize contentType;
15
- @synthesize content;
16
-
17
- - (id)initWithLocation:(GHLocation *)theLocation contentType:(NSString *)theContentType content:(NSString *)theContent
18
- {
19
- if (self = [super init])
20
- {
21
- location = theLocation;
22
- contentType = theContentType;
23
- content = theContent;
24
- }
25
-
26
- return self;
27
- }
28
-
29
- @end
@@ -1,24 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import <Foundation/Foundation.h>
3
- #import "GHHasLocationProtocol.h"
4
- #import "GHHasDescriptionProtocol.h"
5
- #import "GHHasRowsProtocol.h"
6
- #import "GHHasTagsProtocol.h"
7
-
8
- @class GHTag;
9
- @class GHTableRow;
10
-
11
- @interface GHExamples : NSObject <GHHasLocationProtocol, GHHasDescriptionProtocol, GHHasRowsProtocol, GHHasTagsProtocol>
12
-
13
- @property (nonatomic, readonly) NSArray<GHTag *> * tags;
14
- @property (nonatomic, readonly) GHLocation * location;
15
- @property (nonatomic, readonly) NSString * keyword;
16
- @property (nonatomic, readonly) NSString * name;
17
- @property (nonatomic, readonly) NSString * desc;
18
- @property (nonatomic, readonly) GHTableRow * tableHeader;
19
- @property (nonatomic, readonly) NSArray<GHTableRow *> * tableBody;
20
-
21
- - (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription header:(GHTableRow *)theHeader body:(NSArray<GHTableRow *> *)theBody;
22
-
23
-
24
- @end
@@ -1,49 +0,0 @@
1
- #import "GHExamples.h"
2
-
3
- #import "GHTag.h"
4
- #import "GHTableRow.h"
5
-
6
- @interface GHExamples ()
7
-
8
- @property (nonatomic, strong) NSArray<GHTag *> * tags;
9
- @property (nonatomic, strong) GHLocation * location;
10
- @property (nonatomic, strong) NSString * keyword;
11
- @property (nonatomic, strong) NSString * name;
12
- @property (nonatomic, strong) NSString * desc;
13
- @property (nonatomic, strong) GHTableRow * tableHeader;
14
- @property (nonatomic, strong) NSArray<GHTableRow *> * tableBody;
15
-
16
- @end
17
-
18
- @implementation GHExamples
19
-
20
- @synthesize tags;
21
- @synthesize location;
22
- @synthesize keyword;
23
- @synthesize name;
24
- @synthesize desc;
25
- @synthesize tableHeader;
26
- @synthesize tableBody;
27
-
28
- - (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription header:(GHTableRow *)theHeader body:(NSArray<GHTableRow *> *)theBody
29
- {
30
- if (self = [super init])
31
- {
32
- tags = theTags;
33
- location = theLocation;
34
- keyword = theKeyword;
35
- name = theName;
36
- desc = theDescription;
37
- tableHeader = theHeader;
38
- tableBody = theBody;
39
- }
40
-
41
- return self;
42
- }
43
-
44
- - (NSArray<GHTableRow *> *)rows
45
- {
46
- return [@[ tableHeader ] arrayByAddingObjectsFromArray: tableBody];
47
- }
48
-
49
- @end
@@ -1,24 +0,0 @@
1
- #import "GHHasLocationProtocol.h"
2
- #import "GHHasDescriptionProtocol.h"
3
- #import "GHHasTagsProtocol.h"
4
-
5
- @class GHTag;
6
- @class GHLocation;
7
- @class GHBackground;
8
- @class GHScenarioDefinition;
9
- @class GHComment;
10
-
11
- @interface GHFeature : NSObject <GHHasLocationProtocol, GHHasDescriptionProtocol, GHHasTagsProtocol>
12
-
13
- @property (nonatomic, readonly) NSArray<GHTag *> * tags;
14
- @property (nonatomic, readonly) GHLocation * location;
15
- @property (nonatomic, readonly) NSString * language;
16
- @property (nonatomic, readonly) NSString * keyword;
17
- @property (nonatomic, readonly) NSString * name;
18
- @property (nonatomic, readonly) NSString * desc;
19
- @property (nonatomic, readonly) NSArray<GHScenarioDefinition *> * children;
20
- @property (nonatomic, readonly) NSArray<GHComment *> * comments;
21
-
22
- - (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation language:(NSString *)theLanguage keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription children:(NSArray<GHScenarioDefinition *> *)theChildren comments:(NSArray<GHComment *> *)theComments;
23
-
24
- @end
@@ -1,50 +0,0 @@
1
- #import "GHFeature.h"
2
-
3
- #import "GHTag.h"
4
- #import "GHLocation.h"
5
- #import "GHBackground.h"
6
- #import "GHScenarioDefinition.h"
7
- #import "GHComment.h"
8
-
9
- @interface GHFeature ()
10
-
11
- @property (nonatomic, strong) NSArray<GHTag *> * tags;
12
- @property (nonatomic, strong) GHLocation * location;
13
- @property (nonatomic, strong) NSString * language;
14
- @property (nonatomic, strong) NSString * keyword;
15
- @property (nonatomic, strong) NSString * name;
16
- @property (nonatomic, strong) NSString * desc;
17
- @property (nonatomic, strong) NSArray<GHScenarioDefinition *> * children;
18
- @property (nonatomic, strong) NSArray<GHComment *> * comments;
19
-
20
- @end
21
-
22
- @implementation GHFeature
23
-
24
- @synthesize tags;
25
- @synthesize location;
26
- @synthesize language;
27
- @synthesize keyword;
28
- @synthesize name;
29
- @synthesize desc;
30
- @synthesize children;
31
- @synthesize comments;
32
-
33
- - (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation language:(NSString *)theLanguage keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription children:(NSArray<GHScenarioDefinition *> *)theChildren comments:(NSArray<GHComment *> *)theComments
34
- {
35
- if (self = [super init])
36
- {
37
- tags = theTags;
38
- location = theLocation;
39
- language = theLanguage;
40
- keyword = theKeyword;
41
- name = theName;
42
- desc = theDescription;
43
- children = theChildren;
44
- comments = theComments;
45
- }
46
-
47
- return self;
48
- }
49
-
50
- @end
@@ -1,25 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- @interface GHGherkinDialect : NSObject
4
-
5
- @property (nonatomic, readonly) NSString * language;
6
- @property (nonatomic, readonly) NSArray<NSString *> * featureKeywords;
7
- @property (nonatomic, readonly) NSArray<NSString *> * backgroundKeywords;
8
- @property (nonatomic, readonly) NSArray<NSString *> * scenarioKeywords;
9
- @property (nonatomic, readonly) NSArray<NSString *> * scenarioOutlineKeywords;
10
- @property (nonatomic, readonly) NSArray<NSString *> * examplesKeywords;
11
- @property (nonatomic, readonly) NSArray<NSString *> * givenStepKeywords;
12
- @property (nonatomic, readonly) NSArray<NSString *> * whenStepKeywords;
13
- @property (nonatomic, readonly) NSArray<NSString *> * thenStepKeywords;
14
- @property (nonatomic, readonly) NSArray<NSString *> * andStepKeywords;
15
- @property (nonatomic, readonly) NSArray<NSString *> * butStepKeywords;
16
- @property (nonatomic, readonly) NSArray<NSString *> * stepKeywords;
17
-
18
- - (id)initWithLanguage:(NSString *)theLanguage featureKeywords:(NSArray<NSString *> *)theFeatureKeywords
19
- backgroundKeywords:(NSArray<NSString *> *)theBackgroundKeywords scenarioKeywords:(NSArray<NSString *> *)theScenarioKeywords
20
- scenarioOutlineKeywords:(NSArray<NSString *> *)theScenarioOutlineKeywords examplesKeywords:(NSArray<NSString *> *)theExamplesKeywords
21
- givenStepKeywords:(NSArray<NSString *> *)theGivenStepKeywords whenStepKeywords:(NSArray<NSString *> *)theWhenStepKeywords
22
- thenStepKeywords:(NSArray<NSString *> *)theThenStepKeywords andStepKeywords:(NSArray<NSString *> *)theAndStepKeywords
23
- butStepKeywords:(NSArray<NSString *> *)theButStepKeywords;
24
-
25
- @end
@@ -1,64 +0,0 @@
1
- #import "GHGherkinDialect.h"
2
-
3
- @interface GHGherkinDialect ()
4
-
5
- @property (nonatomic, strong) NSString * language;
6
- @property (nonatomic, strong) NSArray<NSString *> * featureKeywords;
7
- @property (nonatomic, strong) NSArray<NSString *> * backgroundKeywords;
8
- @property (nonatomic, strong) NSArray<NSString *> * scenarioKeywords;
9
- @property (nonatomic, strong) NSArray<NSString *> * scenarioOutlineKeywords;
10
- @property (nonatomic, strong) NSArray<NSString *> * examplesKeywords;
11
- @property (nonatomic, strong) NSArray<NSString *> * givenStepKeywords;
12
- @property (nonatomic, strong) NSArray<NSString *> * whenStepKeywords;
13
- @property (nonatomic, strong) NSArray<NSString *> * thenStepKeywords;
14
- @property (nonatomic, strong) NSArray<NSString *> * andStepKeywords;
15
- @property (nonatomic, strong) NSArray<NSString *> * butStepKeywords;
16
- @property (nonatomic, strong) NSArray<NSString *> * stepKeywords;
17
-
18
- @end
19
-
20
- @implementation GHGherkinDialect
21
-
22
- @synthesize language;
23
- @synthesize featureKeywords;
24
- @synthesize backgroundKeywords;
25
- @synthesize scenarioKeywords;
26
- @synthesize scenarioOutlineKeywords;
27
- @synthesize examplesKeywords;
28
- @synthesize givenStepKeywords;
29
- @synthesize whenStepKeywords;
30
- @synthesize thenStepKeywords;
31
- @synthesize andStepKeywords;
32
- @synthesize butStepKeywords;
33
- @synthesize stepKeywords;
34
-
35
- - (id)initWithLanguage:(NSString *)theLanguage featureKeywords:(NSArray<NSString *> *)theFeatureKeywords
36
- backgroundKeywords:(NSArray<NSString *> *)theBackgroundKeywords scenarioKeywords:(NSArray<NSString *> *)theScenarioKeywords
37
- scenarioOutlineKeywords:(NSArray<NSString *> *)theScenarioOutlineKeywords examplesKeywords:(NSArray<NSString *> *)theExamplesKeywords
38
- givenStepKeywords:(NSArray<NSString *> *)theGivenStepKeywords whenStepKeywords:(NSArray<NSString *> *)theWhenStepKeywords
39
- thenStepKeywords:(NSArray<NSString *> *)theThenStepKeywords andStepKeywords:(NSArray<NSString *> *)theAndStepKeywords
40
- butStepKeywords:(NSArray<NSString *> *)theButStepKeywords
41
- {
42
- if (self = [super init])
43
- {
44
- language = theLanguage;
45
- featureKeywords = theFeatureKeywords;
46
- backgroundKeywords = theBackgroundKeywords;
47
- scenarioKeywords = theScenarioKeywords;
48
- scenarioOutlineKeywords = theScenarioOutlineKeywords;
49
- examplesKeywords = theExamplesKeywords;
50
- givenStepKeywords = theGivenStepKeywords;
51
- whenStepKeywords = theWhenStepKeywords;
52
- thenStepKeywords = theThenStepKeywords;
53
- andStepKeywords = theAndStepKeywords;
54
- butStepKeywords = theButStepKeywords;
55
-
56
- stepKeywords = [[[[givenStepKeywords arrayByAddingObjectsFromArray: whenStepKeywords] arrayByAddingObjectsFromArray: thenStepKeywords] arrayByAddingObjectsFromArray: andStepKeywords] arrayByAddingObjectsFromArray: butStepKeywords];
57
- // Distinct using an NSOrderedSet
58
- stepKeywords = [[[NSOrderedSet alloc] initWithArray: stepKeywords] array];
59
- }
60
-
61
- return self;
62
- }
63
-
64
- @end
@@ -1,9 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- #import "GHGherkinDialectProviderProtocol.h"
4
-
5
- @interface GHGherkinDialectProvider : NSObject <GHGherkinDialectProviderProtocol>
6
-
7
- - (id)initWithLanguage:(NSString *)theLanguage;
8
-
9
- @end
@@ -1,124 +0,0 @@
1
- #import "GHGherkinDialectProvider.h"
2
-
3
- #import "GHGherkinDialect.h"
4
- #import "GHGherkinLanguageSetting.h"
5
- #import "GHLocation.h"
6
- #import "GHParserException.h"
7
-
8
- @interface GHGherkinDialectProvider ()
9
-
10
- - (GHGherkinDialect *)dialectWithLanguage:(NSString *)theLanguage languageSetting:(GHGherkinLanguageSetting *)theLanguageSetting;
11
- - (GHGherkinDialect *)dialectWithLanguage:(NSString *)theLanguage languagesSetting:(NSDictionary<NSString *, GHGherkinLanguageSetting *> *)theLanguagesSetting location:(GHLocation *)theLocation;
12
- - (NSDictionary<NSString *, GHGherkinLanguageSetting *> *)parseJsonContent:(NSData *)theLanguagesFileContent;
13
- - (NSDictionary<NSString *, GHGherkinLanguageSetting *> *)languagesSetting;
14
-
15
- - (NSArray<NSString *> *)parseStepKeywords:(NSArray<NSString *> *)theStepKeywords;
16
- - (NSArray<NSString *> *)parseTitleKeywords:(NSArray<NSString *> *)theKeywords;
17
-
18
- @end
19
-
20
- @implementation GHGherkinDialectProvider
21
- {
22
- GHGherkinDialect * defaultDialect;
23
- NSString * language;
24
- }
25
-
26
- - (GHGherkinDialect *)defaultDialect
27
- {
28
- return [self dialectWithLanguage: language location: nil];
29
- }
30
-
31
- - (id)init
32
- {
33
- return [self initWithLanguage: @"en"];
34
- }
35
-
36
- - (id)initWithLanguage:(NSString *)theLanguage
37
- {
38
- if (self = [super init])
39
- {
40
- language = theLanguage;
41
- }
42
-
43
- return self;
44
- }
45
-
46
- - (GHGherkinDialect *)dialectWithLanguage:(NSString *)theLanguage location:(GHLocation *)theLocation
47
- {
48
- NSDictionary<NSString *, GHGherkinLanguageSetting *> * languagesSetting = [self languagesSetting];
49
-
50
- return [self dialectWithLanguage: theLanguage languagesSetting: languagesSetting location: theLocation];
51
- }
52
-
53
- - (NSDictionary<NSString *, GHGherkinLanguageSetting *> *)languagesSetting
54
- {
55
- NSBundle * gherkinLanguagesBundle = [NSBundle bundleWithPath: [[NSBundle bundleForClass:[self class]] pathForResource: @"GherkinLanguages" ofType: @"bundle"]];
56
- if(gherkinLanguagesBundle == nil){
57
- gherkinLanguagesBundle = [NSBundle bundleForClass:[self class]];
58
- }
59
- NSData * languagesFileContent = [NSData dataWithContentsOfFile: [gherkinLanguagesBundle pathForResource: @"gherkin-languages" ofType: @"json"]];
60
-
61
- /*TODO: check for error
62
- if (resourceStream == null)
63
- throw new InvalidOperationException("Gherkin language resource not found: " + languageFileName);*/
64
-
65
- return [self parseJsonContent: languagesFileContent];
66
- }
67
-
68
- - (NSDictionary<NSString *, GHGherkinLanguageSetting *> *)parseJsonContent:(NSData *)theLanguagesFileContent
69
- {
70
- NSError * error;
71
- NSDictionary<NSString *, GHGherkinLanguageSetting *> * languagesSetting = nil;
72
- id parsingResult = [NSJSONSerialization JSONObjectWithData: theLanguagesFileContent options: 0 error: &error];
73
- if (parsingResult)
74
- {
75
- NSMutableDictionary<NSString *, GHGherkinLanguageSetting *> * languagesSettingBuffer = [[NSMutableDictionary<NSString *, GHGherkinLanguageSetting *> alloc] initWithCapacity: [parsingResult count]];
76
- for (NSString * languageKey in parsingResult)
77
- {
78
- NSDictionary * languageSettingDictionary = parsingResult[languageKey];
79
- GHGherkinLanguageSetting * languageSetting = [[GHGherkinLanguageSetting alloc] init];
80
- [languageSetting setValuesForKeysWithDictionary: languageSettingDictionary];
81
-
82
- languagesSettingBuffer[languageKey] = languageSetting;
83
- }
84
- languagesSetting = [[NSDictionary<NSString *, GHGherkinLanguageSetting *> alloc] initWithDictionary: languagesSettingBuffer];
85
- }
86
-
87
- return languagesSetting;
88
- }
89
-
90
- - (GHGherkinDialect *)dialectWithLanguage:(NSString *)theLanguage languagesSetting:(NSDictionary<NSString *, GHGherkinLanguageSetting *> *)theLanguagesSetting location:(GHLocation *)theLocation
91
- {
92
- GHGherkinLanguageSetting * languageSetting = nil;
93
- if ((languageSetting = theLanguagesSetting[theLanguage]) == nil)
94
- @throw [[GHNoSuchLanguageException alloc] initWithLanguage: theLanguage location: theLocation];
95
-
96
- return [self dialectWithLanguage: theLanguage languageSetting: languageSetting];
97
- }
98
-
99
- - (GHGherkinDialect *)dialectWithLanguage:(NSString *)theLanguage languageSetting:(GHGherkinLanguageSetting *)theLanguageSetting
100
- {
101
- return [[GHGherkinDialect alloc] initWithLanguage: theLanguage
102
- featureKeywords: [self parseTitleKeywords: theLanguageSetting.feature]
103
- backgroundKeywords: [self parseTitleKeywords: theLanguageSetting.background]
104
- scenarioKeywords: [self parseTitleKeywords: theLanguageSetting.scenario]
105
- scenarioOutlineKeywords: [self parseTitleKeywords: theLanguageSetting.scenarioOutline]
106
- examplesKeywords: [self parseTitleKeywords: theLanguageSetting.examples]
107
- givenStepKeywords: [self parseStepKeywords: theLanguageSetting.given]
108
- whenStepKeywords: [self parseStepKeywords: theLanguageSetting.when]
109
- thenStepKeywords: [self parseStepKeywords: theLanguageSetting.then]
110
- andStepKeywords: [self parseStepKeywords: theLanguageSetting.and]
111
- butStepKeywords: [self parseStepKeywords: theLanguageSetting.but]];
112
- }
113
-
114
- - (NSArray<NSString *> *)parseStepKeywords:(NSArray<NSString *> *)theStepKeywords
115
- {
116
- return theStepKeywords;
117
- }
118
-
119
- - (NSArray<NSString *> *)parseTitleKeywords:(NSArray<NSString *> *)theKeywords
120
- {
121
- return theKeywords;
122
- }
123
-
124
- @end