最终清理规格2

tgr*_*tgr 8 scala specs2

我正在为我的scala软件编写specs2 Unittest.执行效果很好.我唯一的问题是,我需要在完成所有测试后进行清理.我找不到任何解决方案.所有测试完成后有没有办法执行某些功能?

Eri*_*ric 10

您需要在规范的末尾添加一个步骤:

import org.specs2.mutable._

class MySpec extends Specification {

  // lots of examples here

  // cleanup there
  step(cleanUp())
}
Run Code Online (Sandbox Code Playgroud)