当前位置: 动力学知识库 > 问答 > 编程问答 >

scala - Run all tests without the @RunWith(classOf[JUnitRunner]) dance?

问题描述:

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).

分享给朋友:
您可能感兴趣的文章:
随机阅读: