These are chat archives for etorreborre/specs2

28th
Jul 2015
Eric Torreborre
@etorreborre
Jul 28 2015 08:17
Sorry @dcsobral I didn’t get the notification from Gitter and I’m not checking out this room very often.
There are Task matchers and they are indeed not documented (I’ll fix that): https://github.com/etorreborre/specs2/blob/master/matcher-extra/src/main/scala-scalaz-7.1.x/org/specs2/matcher/TaskMatchers.scala. They are available in the specs2-matcher-extra jar
@lucianenache you indeed need to have an ExecutionEnv but it’s easy to get: class MySpec(implicit ee: ExecutionEnv) extends Specification
the reason why you need it is that I want to be able to shutdown resources when the tests are over and avoid leaking threads.
@dcsobral if you want to negate a MatchResult you can use the negate method on it.
I’ll try to leave gitter open more often from now on...
Lucian Enache
@lucianenache
Jul 28 2015 08:34
@etorreborre That's a nice optimization that you came up with, thanks for sharing :)
Daniel Capo Sobral
@dcsobral
Jul 28 2015 08:39
@etorreborre It works mostly fine, but the “beEmpty” matcher failes.
It seems to be defined in terms of { def isEmpty: Boolean }, and that fails the value matcher for returnValue.
Eric Torreborre
@etorreborre
Jul 28 2015 09:40
I'll have a look at that
Eric Torreborre
@etorreborre
Jul 28 2015 10:49
@dcsobral can you give me an example of beEmpty.negate not working? This passes ok for me in an immutable spec:
val r = List(1) must beEmpty
 r.negate
Daniel Capo Sobral
@dcsobral
Jul 28 2015 18:42
@etorreborre I meant the task matchers.
must returnValue(beEmpty) doesn’t work