Getting detailed information about failed scala / maven / specs tests

I play a little with scala using the maven and scala plugin.

I can’t find a way to test mvn the details of the crash report - in particular, whenever a function returns an incorrect answer, I get error information, but I have no way to see THAT the wrong answer was reported.

For example, with a test like:

object MyTestSpec extends Specification {

  "my_function" should {
      "return proper value for 3" {
           val cnt = MyCode.my_function(3)
           cnt must be_==(3)
      }
  }
}

if my function returns something other than 3, I only get

Failed tests:
  my_function should return proper value for 3

but there is no information about what value was really returned.

Is there any way to get this information (besides entering manual println)?

+3
source share
2 answers

Maven JUnit , . , target/site/surefire-reports/MyTestSpecs.txt.

Maven sbt-0.6.9 (Simple Build Tool), .

.

+2
cnt aka "my_function return value" must be_==(3)
+2

Source: https://habr.com/ru/post/1727039/


All Articles