use of org.jbehave.core.steps.StepType in project jbehave-core by jbehave.
the class StepCandidateBehaviour method shouldNotMatchOrIgnoreStepWhenStartingWordNotFound.
@Test
public void shouldNotMatchOrIgnoreStepWhenStartingWordNotFound() throws Exception {
Method method = SomeSteps.class.getMethod("aMethod");
Keywords keywords = new LocalizedKeywords() {
@Override
public String startingWordFor(StepType stepType) {
throw new StartingWordNotFound(stepType, new HashMap<StepType, String>());
}
};
ParameterConverters parameterConverters = new ParameterConverters(new LoadFromClasspath(), new TableTransformers());
StepCandidate candidate = new StepCandidate("windows on the $nth floor", 0, WHEN, method, null, null, new StepsContext(), keywords, new RegexPrefixCapturingPatternParser(), parameterConverters, new ParameterControls());
assertThat(candidate.matches("When windows on the 1st floor"), is(false));
assertThat(candidate.ignore("!-- windows on the 1st floor"), is(false));
}
use of org.jbehave.core.steps.StepType in project jbehave-core by jbehave.
the class LocalizedKeywordsBehaviour method ensureKeywordsAreLocalised.
private void ensureKeywordsAreLocalised(Configuration configuration, Locale locale) {
Keywords keywords = keywordsFor(locale, null, null);
Map<StepType, String> startingWordsByType = keywords.startingWordsByType();
assertThat(startingWordsByType.get(StepType.GIVEN), equalTo(keywords.given()));
assertThat(startingWordsByType.get(StepType.WHEN), equalTo(keywords.when()));
assertThat(startingWordsByType.get(StepType.THEN), equalTo(keywords.then()));
assertThat(startingWordsByType.get(StepType.AND), equalTo(keywords.and()));
assertThat(startingWordsByType.get(StepType.IGNORABLE), equalTo(keywords.ignorable()));
}
Aggregations