Skip to content

Sample configuration for using Maven and Spek Test Runner Plugin

Notifications You must be signed in to change notification settings

spekframework/spek-maven-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spek Maven Sample

This is a sample Maven project that uses Maven to run tests (in a CI scenario for instance). You can still run tests individually in the IDE using the Spek IntelliJ IDEA plugin

Setup

Dependencies

Check the pom.xml to understand all the dependencies required.

Test Patterns

Spek uses the Maven Surefire plugin to find and run tests. Make sure that if you're not following default conventions for test location and names (often you're not with Spek), that you include the correct pattern in the configuration of the plugin the pom.xml file

In our case, tests are under src/test/kotlin/ and have the pattern Spec.kt

 <plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.19</version>

    <dependencies>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-surefire-provider</artifactId>
            <version>1.0.0-M4</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.0.0-M4</version>
        </dependency>
    </dependencies>
    <configuration>
        <includes>
            <include>**/*Spec.*</include>
        </includes>
    </configuration>
</plugin>

Running

To run individual tests, you can use the Spek IntelliJ IDEA plugin

You can run tests with Maven using mvn test

About

Sample configuration for using Maven and Spek Test Runner Plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages