use of org.jbehave.core.steps.StepFinder in project jbehave-core by jbehave.
the class EmbedderBehaviour method shouldReportAllStepdocs.
@Test
public void shouldReportAllStepdocs() {
// Given
Embedder embedder = new Embedder();
embedder.useCandidateSteps(asList((CandidateSteps) new MySteps()));
embedder.configuration().useStepFinder(new StepFinder());
OutputStream out = new ByteArrayOutputStream();
embedder.configuration().useStepdocReporter(new PrintStreamStepdocReporter(new PrintStream(out)));
// When
embedder.reportStepdocs();
// Then
String output = dos2unix(out.toString());
assertThat(output, containsString("'Given a given'\n" + "org.jbehave.core.embedder.EmbedderBehaviour$MySteps.given()\n"));
assertThat(output, containsString("'When a when'\n" + "org.jbehave.core.embedder.EmbedderBehaviour$MySteps.when()\n"));
assertThat(output, containsString("'Then a then'\n" + "org.jbehave.core.embedder.EmbedderBehaviour$MySteps.then()\n"));
assertThat(output, containsString("from steps instances:\norg.jbehave.core.embedder.EmbedderBehaviour$MySteps\n"));
}
use of org.jbehave.core.steps.StepFinder in project jbehave-core by jbehave.
the class Embedder method reportMatchingStepdocs.
public void reportMatchingStepdocs(String stepAsString) {
Configuration configuration = configuration();
List<CandidateSteps> candidateSteps = candidateSteps();
StepFinder finder = configuration.stepFinder();
StepdocReporter reporter = configuration.stepdocReporter();
List<Stepdoc> matching = finder.findMatching(stepAsString, candidateSteps);
List<Object> stepsInstances = finder.stepsInstances(candidateSteps);
reporter.stepdocsMatching(stepAsString, matching, stepsInstances);
}
use of org.jbehave.core.steps.StepFinder in project jbehave-core by jbehave.
the class Embedder method reportStepdocs.
public void reportStepdocs(Configuration configuration, List<CandidateSteps> candidateSteps) {
StepFinder finder = configuration.stepFinder();
StepdocReporter reporter = configuration.stepdocReporter();
List<Object> stepsInstances = finder.stepsInstances(candidateSteps);
reporter.stepdocs(finder.stepdocs(candidateSteps), stepsInstances);
}
Aggregations