spek

Use JUnit5 Tags for Spek

两盒软妹~` 提交于 2020-01-03 15:15:22
问题 I am trying to distinguish my tests into Unit- and Integration tests. My idea was to use the new JUnit5 Annotation @Tag("unit") which works nicely for my JUnit tests, but I cannot get it to work with Spek. What I currently have is my class: data class MyObject(val value: Int) My tests: @Tag("unit") object MyObjectTest { @Test fun checkEquality() { val o1 = MyObject(1) assertEquals(o1, o1) } } With my build.gradle having: task utest(type: Test) { outputs.upToDateWhen { false } useJUnitPlatform

Android Studio + Spek integration

江枫思渺然 提交于 2019-12-10 14:17:59
问题 I'm trying to add Spek testing framework to my Android Studio project. Following the instructions Here, I ended up adding the following to my module build.gradle : testCompile 'org.jetbrains.spek:spek-api:1.1.5' testCompile 'junit:junit:4.12' testCompile "org.junit.platform:junit-platform-runner:1.0.0" testRuntimeOnly 'org.jetbrains.spek:spek-junit-platform-engine:1.1.5' Then I annotated my test with @RunWith(JUnitPlatform::class) However, when I try to run the test, I get: org.junit.platform