These are chat archives for etorreborre/specs2

Oct 2017
Raphael Mäder
Oct 26 2017 07:42
Will try that, thanks for the hint :+1: To the second point, what would you suggest to use instead of Mockito then? Scalamock?
Raphael Mäder
Oct 26 2017 15:53

Ok I think I found the problem. I made two mocks in the same method:

val bm = mock[BootstrapService[IO]].smart
bm.setup returns IO { false }
val pm = mock[PageService[IO]].smart
pm.findVisible returns IO { List(page) }

which fails. But this works:

val bs = mock[BootstrapService[IO]].smart
val ps = mock[PageService[IO]].smart
bs.setup returns IO { false }
ps.findVisible returns IO { List(page) }

Do mocks always have to be defined in the beginning of the test method?

Eric Torreborre
Oct 26 2017 16:27
I haven't had seen this issue before but on the other hand mockito is very mutable under the covers (the price of being "practical") so that is not so surprising