use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.
the class ScanningStepsFactoryBehaviour method shouldNotFindAnyStepsFromNonAnnotatedClasses.
@Test
public void shouldNotFindAnyStepsFromNonAnnotatedClasses() {
InjectableStepsFactory factory = new ScanningStepsFactory(new MostUsefulConfiguration(), "org.jbehave.core.steps.scan2");
List<CandidateSteps> candidateSteps = factory.createCandidateSteps();
assertThat(candidateSteps.size(), Matchers.equalTo(0));
}
use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.
the class ScanningStepsFactoryBehaviour method shouldNotFindAnyStepsFromInexistingPackage.
@Test
public void shouldNotFindAnyStepsFromInexistingPackage() {
InjectableStepsFactory factory = new ScanningStepsFactory(new MostUsefulConfiguration(), "org.jbehave.inexisting");
List<CandidateSteps> candidateSteps = factory.createCandidateSteps();
assertThat(candidateSteps.size(), Matchers.equalTo(0));
}
use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.
the class StepCandidateBehaviour method candidateWith.
private StepCandidate candidateWith(String patternAsString, StepType stepType, Method method, Object instance, ParameterControls parameterControls) {
Class<?> stepsType = instance.getClass();
MostUsefulConfiguration configuration = new MostUsefulConfiguration();
InjectableStepsFactory stepsFactory = new InstanceStepsFactory(configuration, instance);
return new StepCandidate(patternAsString, 0, stepType, method, stepsType, stepsFactory, new StepsContext(), keywords, new RegexPrefixCapturingPatternParser(), configuration.parameterConverters(), parameterControls);
}
use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.
the class StepCandidateBehaviour method shouldPerformStepsInDryRunMode.
@Test
public void shouldPerformStepsInDryRunMode() {
Configuration configuration = new MostUsefulConfiguration();
configuration.storyControls().doDryRun(true);
NamedTypeSteps steps = new NamedTypeSteps(configuration);
List<StepCandidate> candidates = steps.listCandidates();
assertThat(candidates.size(), equalTo(2));
StepCandidate step0 = candidateMatchingStep(candidates, "Given foo named $name");
step0.createMatchedStep("Given foo named xyz", namedParameters).perform(null);
step0.createMatchedStep("And foo named xyz", namedParameters).perform(null);
StepCandidate step1 = candidateMatchingStep(candidates, "When foo named $name");
step1.createMatchedStep("When foo named Bar", namedParameters).perform(null);
step1.createMatchedStep("And foo named Bar", namedParameters).perform(null);
assertThat(steps.givenName, nullValue());
assertThat(steps.givenTimes, equalTo(0));
assertThat(steps.whenName, nullValue());
assertThat(steps.whenTimes, equalTo(0));
}
use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.
the class GroovyAnnotationBuilderBehaviour method shouldBuildDefaultConfigurationIfAnnotationOrAnnotatedValuesNotPresent.
@Test
public void shouldBuildDefaultConfigurationIfAnnotationOrAnnotatedValuesNotPresent() {
GroovyAnnotationBuilder builderNotAnnotated = new GroovyAnnotationBuilder(NotAnnotated.class);
assertThatConfigurationIs(builderNotAnnotated.buildConfiguration(), new MostUsefulConfiguration());
}
Aggregations