These are chat archives for etorreborre/specs2

28th
Mar 2017
João Ferreira
@jtjeferreira
Mar 28 2017 15:43
Hi. Considerig the following spec
package examples

import org.specs2._

class TestSpec extends mutable.Specification  {
  val random = new scala.util.Random

  "Random tests" >> {
    "test a" >> {
      println("a1")
      Thread.sleep(50*random.nextInt(1))
      println("a2")
      success
    }
    "test b" >> {
      println("b1")
      Thread.sleep(50*random.nextInt(1))
      println("b2")
      success
    }
  }
}
that outputs
[info] Compiling 1 Scala source to /home/joao/git/nezasa/platform/target/scala-2.11/test-classes...
a1
a2
b1
b2
[info] TestSpec
[info] 
[info] Random tests
[info]   + test a (4 ms)
[info]   + test b (0 ms)
[info] 
[info] 
[info] Total for specification TestSpec
[info] Finished in 4 ms
[info] 2 examples, 0 failure, 0 error
[info] 
[info] Passed: Total 2, Failed 0, Errors 0, Passed 2
[success] Total time: 5 s, completed Mar 28, 2017 4:41:32 PM
it there any configuration to print the name of the test that just finished?
something like
[info] TestSpec
[info] 
[info] Random tests
a1
a2
[info]   + test a (4 ms)
b1
b2
[info]   + test b (0 ms)
[info] 
[info] 
[info] Total for specification TestSpec
[info] Finished in 4 ms
[info] 2 examples, 0 failure, 0 error
[info] 
[info] Passed: Total 2, Failed 0, Errors 0, Passed 2
[success] Total time: 5 s, completed Mar 28, 2017 4:41:32 PM
I am using specs2 3.6.6 and my testOptions are List(sequential, true, showtimes, console)
João Ferreira
@jtjeferreira
Mar 28 2017 15:50
I found some old discussions like etorreborre/specs2#39 but I am not even sure they are what I am looking for
Eric Torreborre
@etorreborre
Mar 28 2017 16:53
@jtjeferreira in the latest version of specs2 you will see interleaved example execution and output if you don't use sequential and you have more than 8 tests. Which is a convoluted way to say that this is a regression compared to earlier versions of specs2 where there were ways to see examples printed out as soon as they finished executing. I need to spend time on that but I am slightly short on it at the moment :-)