Open
Description
Not surprisingly, it's going to be hard to work out, and this is partly a note to self to try and solve, but:
Given these reusable tests:
interface Dependency
class StubbedDependency : Dependency
class RealDependency : Dependency
fun someSpecs(
dependency: Dependency
) = stringSpec {
"test 1" { TODO() }
"test 2" { TODO() }
}
class UsingStubbedDependencySpecs : StringSpec({
include(someSpecs(StubbedDependency()))
})
class UsingRealDependencySpecs : StringSpec({
include(someSpecs(RealDependency()))
})
I cannot:
- Run
someSpecs
from the declarationfun someSpecs
- there's no gutter icon - Run
test 2
in isolation - there's no gutter icon - Navigate to the individual test declarations from the Test Results tree in the Run panel
In the equivalent JUnit scenario where you use an abstract super class, all three work; 1 & 2 offer you the options to run against either UsingStubbedDependencySpecs
, or UsingRealDependencySpecs
, or both, and 3 takes you to the test declaration in SomeSpecs
. In:
import org.junit.jupiter.api.Test
abstract class SomeSpecs(
dependency: Dependency
) {
@Test
fun `test 1`() { TODO() }
@Test
fun `test 2`() { TODO() }
}
class UsingStubbedDependencySpecs : SomeSpecs(StubbedDependency())
class UsingRealDependencySpecs : SomeSpecs(RealDependency())
I guess the plugin would need to read the call hierarchy to find all the classes extending *Spec where include is passed the result of function that ultimately calls stringSpec
...