Added Spek2 testing
This commit is contained in:
23
build.gradle
23
build.gradle
@@ -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'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
12
orx-noise/src/test/kotlin/TestMathUtils.kt
Normal file
12
orx-noise/src/test/kotlin/TestMathUtils.kt
Normal 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())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user