These are chat archives for etorreborre/specs2

12th
Oct 2016
Luca Molteni
@lucamolteni
Oct 12 2016 10:50
Hello everyone. I'm trying to create an assertion on a list of functions that should all throw an exception. So far I've been doing list.map(t => func(t) must throwA[Exception) And I'm feeling like I'm on the right track, but now I need to fold the matchers together. I've a Seq[MatchResult[T]] so far
Ideally, I'd like to create something like an any or forall to give different semantics to my match
Eric Torreborre
@etorreborre
Oct 12 2016 10:55
There is a scalaz.Monoid instance for Result so if you go list.map(t => func(t) must throwAn[Exception]).foldMap(_.result) you should get what you want
Luca Molteni
@lucamolteni
Oct 12 2016 13:25
Thanks @etorreborre. It worked!
Peter Schmitz
@petomat
Oct 12 2016 15:19
Hey @etorreborre I recently spotted case class matcher in specs2 2.4.17 which are not documented on UserGuide 2.4.17. Are they usable? Buggy?
Eric Torreborre
@etorreborre
Oct 12 2016 16:51
@petomat I don't remember but they haven't really changed since they were introduced so they should probably work. I think they were not documented at the time because they were still experimental