Added Spek2 testing

This commit is contained in:
Edwin Jakobs
2019-08-14 16:12:26 +02:00
parent e2b59059dc
commit 3c162f30d4
2 changed files with 33 additions and 2 deletions

View File

@@ -37,7 +37,9 @@ plugins {
//} //}
project.ext { project.ext {
openrndrVersion = "0.3.35-rc1" openrndrVersion = "0.3.35"
kotlinVersion = "1.3.41"
spekVersion = "2.0.6"
} }
allprojects { allprojects {
@@ -66,13 +68,25 @@ allprojects {
maven { maven {
url = "https://dl.bintray.com/openrndr/openrndr" url = "https://dl.bintray.com/openrndr/openrndr"
} }
maven {
url "https://dl.bintray.com/spekframework/spek"
}
} }
dependencies { dependencies {
compile "org.openrndr:openrndr-core:$openrndrVersion" compile "org.openrndr:openrndr-core:$openrndrVersion"
compile "org.openrndr:openrndr-filter:$openrndrVersion" compile "org.openrndr:openrndr-filter:$openrndrVersion"
compile "org.openrndr:openrndr-shape:$openrndrVersion" compile "org.openrndr:openrndr-shape:$openrndrVersion"
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.3.0-RC' compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.3.0-RC2'
testImplementation "org.spekframework.spek2:spek-dsl-jvm:$spekVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
testRuntimeOnly "org.spekframework.spek2:spek-runner-junit5:$spekVersion"
testRuntimeOnly "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
} }
contacts { contacts {
@@ -96,4 +110,9 @@ allprojects {
} }
} }
test {
useJUnitPlatform {
includeEngines 'spek2'
}
}
} }

View File

@@ -0,0 +1,12 @@
import org.openrndr.extra.noise.fastFloor
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
import kotlin.test.assertEquals
object TestMathUtils : Spek({
describe("Fast floor") {
it("it is corrrect for 0.0") {
assertEquals(0, 0.0.fastFloor())
}
}
})