use of org.jbehave.core.configuration.groovy.GroovyContext in project jbehave-core by jbehave.
the class GroovyStepsFactoryBehaviour method shouldNotCreateStepsInstancesFromGroovyWhenResourceInvalid.
@Test(expected = GroovyClassInstantiationFailed.class)
public void shouldNotCreateStepsInstancesFromGroovyWhenResourceInvalid() {
GroovyStepsFactory factory = new GroovyStepsFactory(new MostUsefulConfiguration(), new GroovyContext(asList("/org/jbehave/core/steps/groovy/invalidSteps.groovy")));
factory.stepsTypes();
}
use of org.jbehave.core.configuration.groovy.GroovyContext in project jbehave-core by jbehave.
the class GroovyStepsFactoryBehaviour method shouldCreateStepsInstancesFromGroovyWhenAnnotated.
@Test
public void shouldCreateStepsInstancesFromGroovyWhenAnnotated() {
GroovyResourceFinder resourceFinder = new GroovyResourceFinder(codeLocationFromClass(this.getClass()), "**/steps/groovy/*.groovy", "**/invalidSteps.groovy");
GroovyStepsFactory factory = new GroovyStepsFactory(new MostUsefulConfiguration(), new GroovyContext(resourceFinder));
List<Class<?>> types = factory.stepsTypes();
MatcherAssert.assertThat(types.size(), Matchers.equalTo(1));
assertThat(types.get(0).getSimpleName(), equalTo("AnnotatedSteps"));
}
Aggregations