These are chat archives for etorreborre/specs2

29th
Sep 2015
Zacharias J. Beckman
@zbeckman
Sep 29 2015 01:04 UTC
Just reported etorreborre/specs2#414... something changed recently. :( I can no longer run tagged tests. Anyone else run into it? (Getting back Invalid ScalaCheck args: List(include, x) when I try to use --include x)
tony kerz
@tony-kerz
Sep 29 2015 02:35 UTC
@etorreborre here is a branch that incurs those issues: https://github.com/tony-kerz/chronos/tree/tk/specs2-bump
pretty sure mvn compile will do it, let me kno if that isn't the case. tx e!
Eric Torreborre
@etorreborre
Sep 29 2015 03:07 UTC
@tony-kerz I can’t really explain the second error but the fix is to move the import of MockJobUtils outside of the class body and the first fix is to drop the (): doNothing.when(mesosDriver).start()
tony kerz
@tony-kerz
Sep 29 2015 12:33 UTC

nice @etorreborre, that got rid of the red-x's in eclipse (i can see how u had a clue on doNothing, but not sure how u got to the import re-location, but that was genius). the next thing cropped up at runtime:

java.lang.RuntimeException: You shouldn't mixin `org.specs2.matcher.MustExpectations` or `org.specs2.matcher.ShouldExpectations` with `Scope`, use `org.specs2.matcher.MustThrownExpectations` or `org.specs2.matcher.ShouldThrownExpectations` instead.
    at org.apache.mesos.chronos.scheduler.mesos.MesosOfferReviverActorSpec$$anonfun$4$$anonfun$apply$2$$anon$1.<init>(MesosOfferReviverActorSpec.scala:17)
    at org.apache.mesos.chronos.scheduler.mesos.MesosOfferReviverActorSpec$$anonfun$4$$anonfun$apply$2.apply(MesosOfferReviverActorSpec.scala:17)
    at org.apache.mesos.chronos.scheduler.mesos.MesosOfferReviverActorSpec$$anonfun$4$$anonfun$apply$2.apply(MesosOfferReviverActorSpec.scala:17)

for this: https://github.com/mesos/chronos/blob/2.4.0/src/test/scala/org/apache/mesos/chronos/scheduler/mesos/MesosOfferReviverActorSpec.scala

sorry about all this, specs2 is super elegant, but i haven't got all the nuances yet...

Eric Torreborre
@etorreborre
Sep 29 2015 12:38 UTC
Go with ThrownExpectations on your context trait, that should fix it. I'll explain the why tomorrow, it's bedtime now for me :-)
tony kerz
@tony-kerz
Sep 29 2015 17:34 UTC
e to the rescue again: mesos/chronos#566 :shipit:
Eric Torreborre
@etorreborre
Sep 29 2015 22:22 UTC
@tony-kerz an explanation on with ThrownExpectations. When you create a Scope trait like context every expectation you declare inside that trait need to throw an exception when it is failing. Otherwise the failure will be lost. When you mix-in the Mockito trait, and if there is a mocking expectation failure, no exception is thrown by default (because the core of specs2 is functional, side-effects are added on top of it). To change this behaviour you need to mix-in the ThrownExpectation trait. As you can see side-effects make things harder, as usual.