Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

specs2: How to use "failtrace" option

In my specs2 tests, I frequently use helper functions to test groups of conditions at once. Unfortunately, that makes the line number output of failed tests useless, since all failures are on the same line.

Google turned up that there's a "failtrace" option that will output the stack trace of failure. However, I can't find an example of how to actually use that. Is it in build.sbt? Is it used on the SBT command line? Is it set somehow in the constructor of the Specification class?

like image 414
Ben Dilts Avatar asked Apr 16 '14 15:04

Ben Dilts


1 Answers

You can set the failtrace option at the specification level:

class MySpec extends org.specs2.mutable.Specification {
  args.report(failtrace = true)
  ...
}

You can also pass failtrace on the sbt command line:

sbt> test-only *MySpec* -- failtrace
like image 200
Eric Avatar answered Oct 14 '22 21:10

Eric