Specs2 - Tagging tests to run

耗尽温柔 提交于 2019-12-02 03:39:41

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!