Skip to content

Commit

Permalink
Fix quality flaws
Browse files Browse the repository at this point in the history
  • Loading branch information
racodond committed Dec 22, 2016
1 parent ed6f736 commit 19aedcf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public class GherkinDialectProvider {
}
}

private GherkinDialectProvider() {
}

public static GherkinDialect getDialect(String language) {
Map<String, List<String>> map = DIALECTS.get(language);
if (map == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,18 @@ private void setSemanticStepTypes() {

private void setSyntacticStepTypes(String language) {
GherkinDialect dialect = GherkinDialectProvider.getDialect(language);
String prefix;
String stepPrefix;
for (StepTree currentStep : steps) {
prefix = currentStep.prefix().text();
if (dialect.getGivenStepKeywords().contains(prefix)) {
stepPrefix = currentStep.prefix().text();
if (dialect.getGivenStepKeywords().contains(stepPrefix)) {
currentStep.setSyntacticType(StepTree.SyntacticStepType.GIVEN);
} else if (dialect.getWhenStepKeywords().contains(prefix)) {
} else if (dialect.getWhenStepKeywords().contains(stepPrefix)) {
currentStep.setSyntacticType(StepTree.SyntacticStepType.WHEN);
} else if (dialect.getThenStepKeywords().contains(prefix)) {
} else if (dialect.getThenStepKeywords().contains(stepPrefix)) {
currentStep.setSyntacticType(StepTree.SyntacticStepType.THEN);
} else if (dialect.getButStepKeywords().contains(prefix)) {
} else if (dialect.getButStepKeywords().contains(stepPrefix)) {
currentStep.setSyntacticType(StepTree.SyntacticStepType.BUT);
} else if (dialect.getAndStepKeywords().contains(prefix)) {
} else if (dialect.getAndStepKeywords().contains(stepPrefix)) {
currentStep.setSyntacticType(StepTree.SyntacticStepType.AND);
} else {
currentStep.setSyntacticType(StepTree.SyntacticStepType.STAR);
Expand Down

0 comments on commit 19aedcf

Please sign in to comment.