I ran into the same problem with some test suites but not others. I.e. on some right clicking on a test would run the whole suite, while others I could run just one test.
What I finally determined was that a test suite that defined a method in the same scope as the specs would not allow me to run individual tests. Putting those methods inside an object and then importing that object was the easiest refactor to get them out of scope without having to change the test. I.e.
class MySpec extends FlatSpec with Matchers {
"I" should "be able to run just this test" in {
multiply(2,3) shouldBe 6
}
def multiply(a: Int, b: Int): Int = a * b
}
becomes
class MySpec extends FlatSpec with Matchers {
import Helpers._
"I" should "be able to run just this test" in {
multiply(2,3) shouldBe 6
}
object Helpers {
def multiply(a: Int, b: Int): Int = a * b
}
}
The exception is that any test with behaves like
once again breaks the ability to run any single test in the entire suite. And I have not found a syntactic trick to make those work with the IntelliJ runner.