I'm having hard time with "transfering" things in my scala test classes from specs to specs2. Last thing I have is issue with doBefore{}
and some "test" in {}
My "testing" should { doBefore{}
and some "getting" in {} }
give me this error
Description Resource Path Location Type
could not find implicit value for evidence parameter of type org.specs2.execute.AsResult[Unit]
I assume that "Unit" is class in my project, but both doBefore
and in {}
don't return anything so I don't know whats goin on.
My doBefore
's just fill some classes with random values for e.g (this one is in class that extends SpecificationWithJUnit with TestUtil with BeforeExample with AfterExample
"retrieving and counting users by criteria" should {
var user1: User = null
var user2: User = null
var user3: User = null
doBefore {
val params = Map("login" -> "notExist", "roles" -> Seq(someRoles).asJava
val params2 = Map("login" -> "notExistAnother", "roles" -> Seq(someRoles).asJava
val params3 = Map("login" -> "notExistAnotherAnother", "roles" -> Seq(someRoles).asJava).asJava
val users = Seq(params, params2, params3).map( { PopulateUser.insertUserParams(_).asInstanceOf[User] })
user1 = users(0)
user2 = users(1)
user3 = users(2)
}
I'm pretty new to Scala, but Ive read that in specs2 doBefore looks diffrent but to be honest I don't know how should I implement this in my code. I was reading this. So someone know how should I implement this in my code and whats causing that (I mean diffrence beetwen specs and specs2 is huge, but somehow few my test (beside doBefore) are sedning the same error)