Importing test classes into Scala console in sbt?

后端 未结 1 697
南方客
南方客 2021-02-12 11:29

I am building a Scala project in the standard directory layout using sbt. I want to run sbt console and import my unit tests so that I can play with them in the Sca

1条回答
  •  南方客
    南方客 (楼主)
    2021-02-12 11:41

    Use test configuration scope, like this:

    sbt> test:console
    

    For more information, see Scopes in the sbt documentation.

    With specs2 for example, you can go:

    sbt> test:console
    
    console> import mytestpackage._
    console> import org.specs2._
    console> specs2.run(new MySpec)
    

    0 讨论(0)
提交回复
热议问题