Search in sources :

Example 1 with GroovyResourceFinder

use of org.jbehave.core.configuration.groovy.GroovyResourceFinder 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"));
}
Also used : GroovyResourceFinder(org.jbehave.core.configuration.groovy.GroovyResourceFinder) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) CodeLocations.codeLocationFromClass(org.jbehave.core.io.CodeLocations.codeLocationFromClass) GroovyContext(org.jbehave.core.configuration.groovy.GroovyContext) Test(org.junit.Test)

Aggregations

MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)1 GroovyContext (org.jbehave.core.configuration.groovy.GroovyContext)1 GroovyResourceFinder (org.jbehave.core.configuration.groovy.GroovyResourceFinder)1 CodeLocations.codeLocationFromClass (org.jbehave.core.io.CodeLocations.codeLocationFromClass)1 Test (org.junit.Test)1