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,55 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- @class GHLocation;
3
- @class GHToken;
4
-
5
- @interface GHParserException : NSException
6
-
7
- @property (nonatomic, readonly) GHLocation * location;
8
-
9
- @end
10
-
11
- @interface GHAstBuilderException : GHParserException
12
-
13
- - (id)initWithMessage:(NSString *)theMessage;
14
- - (id)initWithMessage:(NSString *)theMessage location:(GHLocation *)theLocation;
15
-
16
- @end
17
-
18
- @interface GHNoSuchLanguageException : GHParserException
19
-
20
- - (id)initWithLanguage:(NSString *)theLanguage location:(GHLocation *)theLocation;
21
-
22
- @end
23
-
24
- @interface GHTokenParserException : GHParserException
25
-
26
- - (id)initWithMessage:(NSString *)theMessage token:(GHToken *)theToken;
27
-
28
- @end
29
-
30
- @interface GHUnexpectedTokenException : GHTokenParserException
31
-
32
- @property (nonatomic, readonly) NSString * stateComment;
33
- @property (nonatomic, readonly) GHToken * receivedToken;
34
- @property (nonatomic, readonly) NSArray<NSString *> * expectedTokenTypes;
35
-
36
- - (id)initWithToken:(GHToken *)theReceivedToken expectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes stateComment:(NSString *)theStateComment;
37
-
38
- @end
39
-
40
- @interface GHUnexpectedEOFException : GHTokenParserException
41
-
42
- @property (nonatomic, readonly) NSString * stateComment;
43
- @property (nonatomic, readonly) NSArray<NSString *> * expectedTokenTypes;
44
-
45
- - (id)initWithToken:(GHToken *)theReceivedToken expectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes stateComment:(NSString *)theStateComment;
46
-
47
- @end
48
-
49
- @interface GHCompositeParserException : GHParserException
50
-
51
- @property (nonatomic, readonly) NSArray<GHParserException *> * errors;
52
-
53
- - (id)initWithErrors:(NSArray<GHParserException *> *)theErrors;
54
-
55
- @end
@@ -1,192 +0,0 @@
1
- #import "GHParserException.h"
2
-
3
- #import "GHLocation.h"
4
- #import "GHToken.h"
5
-
6
- @interface GHParserException ()
7
-
8
- @property (nonatomic, strong) GHLocation * location;
9
-
10
- - (id)initWithMessage:(NSString *)theMessage location:(GHLocation *)theLocation;
11
-
12
- @end
13
-
14
- @implementation GHParserException
15
-
16
- @synthesize location;
17
-
18
- - (id)initWithMessage:(NSString *)theMessage
19
- {
20
- return [super initWithName: NSParseErrorException reason: theMessage userInfo: nil];
21
- }
22
-
23
- - (id)initWithMessage:(NSString *)theMessage location:(GHLocation *)theLocation
24
- {
25
- NSAssert(theLocation != nil, @"Location should not be nil");
26
-
27
- if (self = [super initWithName: NSParseErrorException reason: [[self class] message: theMessage withLocation: theLocation] userInfo: nil])
28
- {
29
- location = theLocation;
30
- }
31
-
32
- return self;
33
- }
34
-
35
- + (NSString *)message:(NSString *)theMessage withLocation:(GHLocation *)theLocation
36
- {
37
- NSAssert(theLocation != nil, @"Location should not be nil");
38
-
39
- return [NSString stringWithFormat: @"(%d:%d): %@", (int)[theLocation line], (int)[theLocation column], theMessage];
40
- }
41
-
42
- @end
43
-
44
- @implementation GHAstBuilderException
45
-
46
- - (id)initWithMessage:(NSString *)theMessage
47
- {
48
- NSAssert(theMessage != nil, @"Message should not be nil");
49
-
50
- return [super initWithMessage: theMessage];
51
- }
52
-
53
- - (id)initWithMessage:(NSString *)theMessage location:(GHLocation *)theLocation
54
- {
55
- NSAssert(theLocation != nil, @"Location should not be nil");
56
- NSAssert(theMessage != nil, @"Location should not be nil");
57
-
58
- return [super initWithMessage: theMessage location: theLocation];
59
- }
60
-
61
- @end
62
-
63
- @implementation GHNoSuchLanguageException
64
-
65
- - (id)initWithLanguage:(NSString *)theLanguage location:(GHLocation *)theLocation
66
- {
67
- return [super initWithMessage: [@"Language not supported: " stringByAppendingString: theLanguage] location: theLocation];
68
- }
69
-
70
- @end
71
-
72
- @implementation GHTokenParserException
73
-
74
- - (id)initWithMessage:(NSString *)theMessage token:(GHToken *)theToken
75
- {
76
- return [super initWithMessage: theMessage location: [[self class] locationWithToken: theToken]];
77
- }
78
-
79
- + (GHLocation *)locationWithToken:(GHToken *)theReceivedToken
80
- {
81
- return [theReceivedToken isEOF] || [[theReceivedToken location] column] > 1
82
- ? [theReceivedToken location]
83
- : [[GHLocation alloc] initWithLine: [[theReceivedToken location] line] column: [[theReceivedToken line] indent] + 1];
84
- }
85
-
86
- @end
87
-
88
- @interface GHUnexpectedTokenException ()
89
-
90
- @property (nonatomic, strong) NSString * stateComment;
91
- @property (nonatomic, strong) GHToken * receivedToken;
92
- @property (nonatomic, strong) NSArray<NSString *> * expectedTokenTypes;
93
-
94
- @end
95
-
96
- @implementation GHUnexpectedTokenException
97
-
98
- @synthesize stateComment;
99
- @synthesize receivedToken;
100
- @synthesize expectedTokenTypes;
101
-
102
- - (id)initWithToken:(GHToken *)theReceivedToken expectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes stateComment:(NSString *)theStateComment
103
- {
104
- NSAssert(theReceivedToken != nil, @"receivedToken should not be nil");
105
- NSAssert(theExpectedTokenTypes != nil, @"expectedTokenTypes should not be nil");
106
-
107
- if (self = [super initWithMessage: [[self class] messageWithToken: theReceivedToken expectedTokenTypes: theExpectedTokenTypes] token: theReceivedToken])
108
- {
109
- receivedToken = theReceivedToken;
110
- expectedTokenTypes = theExpectedTokenTypes;
111
- stateComment = theStateComment;
112
- }
113
-
114
- return self;
115
- }
116
-
117
- + (NSString *)messageWithToken:(GHToken *)theReceivedToken expectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes
118
- {
119
- NSAssert(theReceivedToken != nil, @"receivedToken");
120
- NSAssert(theExpectedTokenTypes != nil, @"expectedTokenTypes");
121
-
122
- return [NSString stringWithFormat: @"expected: %@, got '%@'", [theExpectedTokenTypes componentsJoinedByString: @", "], [[theReceivedToken tokenValue] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]];
123
- }
124
-
125
- @end
126
-
127
- @interface GHUnexpectedEOFException ()
128
-
129
- @property (nonatomic, strong) NSString * stateComment;
130
- @property (nonatomic, strong) NSArray<NSString *> * expectedTokenTypes;
131
-
132
- @end
133
-
134
- @implementation GHUnexpectedEOFException
135
-
136
- @synthesize stateComment;
137
- @synthesize expectedTokenTypes;
138
-
139
- - (id)initWithToken:(GHToken *)theReceivedToken expectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes stateComment:(NSString *)theStateComment
140
- {
141
- NSAssert(theExpectedTokenTypes != nil, @"expectedTokenTypes should not be nil");
142
-
143
- if (self = [super initWithMessage: [[self class] messageWithExpectedTokenTypes: theExpectedTokenTypes] token: theReceivedToken])
144
- {
145
- expectedTokenTypes = theExpectedTokenTypes;
146
- stateComment = theStateComment;
147
- }
148
-
149
- return self;
150
- }
151
-
152
- + (NSString *)messageWithExpectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes
153
- {
154
- NSAssert(theExpectedTokenTypes != nil, @"expectedTokenTypes should not be nil");
155
-
156
- return [NSString stringWithFormat: @"unexpected end of file, expected: %@", [theExpectedTokenTypes componentsJoinedByString: @", "]];
157
- }
158
-
159
- @end
160
-
161
-
162
- @interface GHCompositeParserException ()
163
-
164
- @property (nonatomic, strong) NSArray<GHParserException *> * errors;
165
-
166
- @end
167
-
168
- @implementation GHCompositeParserException
169
-
170
- @synthesize errors;
171
-
172
- - (id)initWithErrors:(NSArray<GHParserException *> *)theErrors
173
- {
174
- NSAssert([theErrors count] != 0, @"Errors list should not be nil or empty");
175
-
176
- if (self = [super initWithMessage: [[self class] messageWithErrors: theErrors]])
177
- {
178
- errors = theErrors;
179
- }
180
-
181
- return self;
182
- }
183
-
184
- + (NSString *)messageWithErrors:(NSArray<GHParserException *> *)theErrors
185
- {
186
- if (!theErrors)
187
- @throw [NSException exceptionWithName: NSInvalidArgumentException reason: @"errors list should not be null" userInfo: nil];
188
-
189
- return [@"Parser errors:\n" stringByAppendingString: [[theErrors valueForKey: @"reason"] componentsJoinedByString: @"\n"]];
190
- }
191
-
192
- @end
@@ -1,14 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "GHScenarioDefinition.h"
3
-
4
- @class GHTag;
5
- @class GHLocation;
6
- @class GHStep;
7
-
8
- @interface GHScenario : GHScenarioDefinition
9
-
10
- @property (nonatomic, readonly) NSArray<GHTag *> * tags;
11
-
12
- - (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps;
13
-
14
- @end
@@ -1,18 +0,0 @@
1
- #import "GHScenario.h"
2
-
3
- #import "GHScenarioDefinition_Private.h"
4
-
5
- #import "GHLocation.h"
6
-
7
- @implementation GHScenario
8
- @synthesize tags;
9
- - (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps
10
- {
11
-
12
- self = [super initWithLocation: theLocation keyword: theKeyword name: theName description: theDescription steps: theSteps];
13
- tags = theTags;
14
- return self;
15
- }
16
-
17
- @end
18
-
@@ -1,23 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "GHHasLocationProtocol.h"
3
- #import "GHHasDescriptionProtocol.h"
4
- #import "GHHasStepsProtocol.h"
5
- #import "GHHasTagsProtocol.h"
6
-
7
- @class GHTag;
8
- @class GHLocation;
9
- @class GHStep;
10
-
11
- @interface GHScenarioDefinition : NSObject <GHHasLocationProtocol, GHHasDescriptionProtocol, GHHasStepsProtocol, GHHasTagsProtocol>
12
-
13
-
14
-
15
- @property (nonatomic, readonly) GHLocation * location;
16
- @property (nonatomic, readonly) NSString * keyword;
17
- @property (nonatomic, readonly) NSString * name;
18
- @property (nonatomic, readonly) NSString * desc;
19
- @property (nonatomic, readonly) NSArray<GHStep *> * steps;
20
-
21
- - (id)initWithLocation:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray *)theSteps;
22
-
23
- @end
@@ -1,41 +0,0 @@
1
- #import "GHScenarioDefinition.h"
2
-
3
- #import "GHScenarioDefinition_Private.h"
4
-
5
- #import "GHTag.h"
6
- #import "GHStep.h"
7
-
8
- @interface GHScenarioDefinition ()
9
-
10
- @property (nonatomic, strong) NSArray<GHTag *> * tags;
11
- @property (nonatomic, strong) GHLocation * location;
12
- @property (nonatomic, strong) NSString * keyword;
13
- @property (nonatomic, strong) NSString * name;
14
- @property (nonatomic, strong) NSString * desc;
15
- @property (nonatomic, strong) NSArray<GHStep *> * steps;
16
-
17
- @end
18
-
19
- @implementation GHScenarioDefinition
20
-
21
- @synthesize location;
22
- @synthesize keyword;
23
- @synthesize name;
24
- @synthesize desc;
25
- @synthesize steps;
26
-
27
- - (id)initWithLocation:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps
28
- {
29
- if (self = [super init])
30
- {
31
- location = theLocation;
32
- keyword = theKeyword;
33
- name = theName;
34
- desc = theDescription;
35
- steps = theSteps;
36
- }
37
-
38
- return self;
39
- }
40
-
41
- @end
@@ -1,6 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- @interface GHScenarioDefinition (Private)
3
-
4
- - (id)initWithLocation:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps;
5
-
6
- @end
@@ -1,15 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "GHScenarioDefinition.h"
3
-
4
- @class GHExamples;
5
-
6
- @interface GHScenarioOutline : GHScenarioDefinition
7
-
8
- @property (nonatomic, readonly) NSArray<GHExamples *> * examples;
9
-
10
- @property (nonatomic, readonly) NSArray<GHTag *> * tags;
11
-
12
-
13
- - (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps examples:(NSArray<GHExamples *> *)theExamples;
14
-
15
- @end
@@ -1,26 +0,0 @@
1
- #import "GHScenarioOutline.h"
2
-
3
- #import "GHScenarioDefinition_Private.h"
4
-
5
- @interface GHScenarioOutline ()
6
-
7
- @property (nonatomic, strong) NSArray<GHExamples *> * examples;
8
-
9
- @end
10
-
11
- @implementation GHScenarioOutline
12
-
13
- @synthesize examples;
14
- @synthesize tags;
15
-
16
- - (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps examples:(NSArray<GHExamples *> *)theExamples
17
- {
18
- if (self = [super initWithLocation: theLocation keyword: theKeyword name: theName description: theDescription steps: theSteps])
19
- {
20
- examples = theExamples;
21
- tags = theTags;
22
- }
23
- return self;
24
- }
25
-
26
- @end
@@ -1,16 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "GHHasLocationProtocol.h"
3
-
4
- @class GHLocation;
5
- @class GHStepArgument;
6
-
7
- @interface GHStep : NSObject <GHHasLocationProtocol>
8
-
9
- @property (nonatomic, readonly) GHLocation * location;
10
- @property (nonatomic, readonly) NSString * keyword;
11
- @property (nonatomic, readonly) NSString * text;
12
- @property (nonatomic, readonly) GHStepArgument * argument;
13
-
14
- - (id)initWithLocation:(GHLocation *)theLocation keyword:(NSString *)theKeyword text:(NSString *)theText stepArgument:(GHStepArgument *)theStepArgument;
15
-
16
- @end
@@ -1,35 +0,0 @@
1
- #import "GHStep.h"
2
-
3
- #import "GHLocation.h"
4
- #import "GHStepArgument.h"
5
-
6
- @interface GHStep ()
7
-
8
- @property (nonatomic, strong) GHLocation * location;
9
- @property (nonatomic, strong) NSString * keyword;
10
- @property (nonatomic, strong) NSString * text;
11
- @property (nonatomic, strong) GHStepArgument * argument;
12
-
13
- @end
14
-
15
- @implementation GHStep
16
-
17
- @synthesize location;
18
- @synthesize keyword;
19
- @synthesize text;
20
- @synthesize argument;
21
-
22
- - (id)initWithLocation:(GHLocation *)theLocation keyword:(NSString *)theKeyword text:(NSString *)theText stepArgument:(GHStepArgument *)theArgument
23
- {
24
- if (self = [super init])
25
- {
26
- location = theLocation;
27
- keyword = theKeyword;
28
- text = theText;
29
- argument = theArgument;
30
- }
31
-
32
- return self;
33
- }
34
-
35
- @end