These are chat archives for etorreborre/specs2

1st
Feb 2017
Paulo "JCranky" Siqueira
@jcranky
Feb 01 2017 09:06
@etorreborre is BeforeAfterAll only available for immutable specs?
Edmondo Porcu
@edmondo1984
Feb 01 2017 17:22

Hello, I have created a Xor Matcher with beARight and beALeft. When one use beArighht but Xor is a left, I would like to show the stacktrace.
I enabled the failtrace like so

testOptions in ThisBuild += Tests.Argument(TestFrameworks.Specs2, "failtrace")

and the matcher looks like this

  def beARight[A](f: ValueCheck[A]): Matcher[Throwable Xor A] = {
    (x: Throwable Xor A) => {
      x fold(ex => Failure(s"The result is a Xor Left: ${ex.getMessage}", ex.getMessage, ex.getStackTrace.toList), f.check)
    }
  }

Nevertheless, when this fails, it doesn't show the stacktrace of the failure. It shows where the failures occurs

Eric Torreborre
@etorreborre
Feb 01 2017 17:43
@jcranky the same trait is available for both type of specs
@edmondo1984 I can't check your matcher right now I'll have a look at it tomorrow
Eric Torreborre
@etorreborre
Feb 01 2017 18:59
@edmundo
Daniel Capo Sobral
@dcsobral
Feb 01 2017 21:56
Someone remind me how to apply a snippet of mutable specs to each value of a list, please?
Eric Torreborre
@etorreborre
Feb 01 2017 22:06
@edmondo1984 btw there are Xor Matchers for cats 0.7.0 in specs2-cats. However I would suggest to use a more recent version of cats and go back to Either if you can.