jGleitz / tutteli-spek-extensions

Extensions for the spek framework such as TempFolder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Download Apache license Build Status Travis Build status GitHub Actions SonarCloud Status SonarCloud Coverage

Tutteli spek extension

A set of Spek extensions such as TempFolder.

#Installation

gradle

repositories {
    maven {
        url  "https://dl.bintray.com/robstoll/tutteli-jars" 
    }
}

dependencies {
    testImplementation 'ch.tutteli.spek:tutteli-spek-extensions:0.4.1'
}

TempFolder

Provides, similar to TemporaryFolder in junit4, utility methods create temp files and folder and takes care of deleting them.

Usage

You have to register it in your Spek as follows:

object MySpec: Spek({
    val tempFolder = TempFolder.perTest() //or perGroup()
    registerListener(tempFolder)
    
    describe("...") {
        it ("...") {
            val file = tempFolder.newFile("test.txt")
        }
    }
})

There are a few other utility methods defined on TempFolder, e.g. newFolder. Please open an issue if you want more or create a pull request.

In case you want to operate on Path we recommend using Niok.

License

tutteli-spek-extensions is licensed under Apache 2.0.

About

Extensions for the spek framework such as TempFolder

License:Apache License 2.0


Languages

Language:Kotlin 59.7%Language:Shell 28.1%Language:Batchfile 11.6%Language:Java 0.6%