问题
I have been using ScalaTest for a while and I find pretty useful the ability to Tag your tests and run just those with a specific Tag from the command line.
Is there anything similar in Specs2?
I know that you can run a specific test class with testOnly but I would like to just run a test with a specific Tag within a Specification.
回答1:
Here is how to do it:
import org.specs2.mutable._
class MySpec extends Specification {
tag("fast")
"example1" >> ok
tag("slow")
"example2" >> ok
}
Then in sbt
sbt> test-only *MySpec* -- include fast
You will find more information here.
来源:https://stackoverflow.com/questions/25645639/specs2-tagging-tests-to-run