问题描述:

Is there any way to set up IntelliJ's JUnit "Run All Tests" command to automatically pick up Scala Specs2? i.e. removing the boilerplate annotation in this snippet:

@RunWith(classOf[JUnitRunner])

class MySpec extends Specification

It's very irritating to have to remember to add this.

I've seen SpecificationWithJUnit but that is also a bit of a hack (and is incompatible with TestKit). I'm looking for a maven/sbt/intelliJ side solution.

网友答案:

With Intellij, you shouldn't need the annotation to execute your specifications, because it has its own specs2 runner. I'm using IntelliJ 123.100 with a recent version of the Scala plugin (82 I think) and things work ok (except for this issue).

相关阅读:
Top