2

I use specs2 in my spray.io project. It all works fine and when I use the following versions.

val akkaV = "2.3.6"
val sprayV = "1.3.2"
val specs2V = "2.3.11"

However, recently I tried to upgrade the akka and spray version to the following.

val akkaV = "2.3.9"
val sprayV = "1.3.3"

When I run my tests now, I get the following error.

object mock is not a member of package org.specs2

I'm not sure how the spray or akka versions affect specs2, but I somehow find this behaviour very odd. I tried different versions of specs2, even the latest one, but the error persists.

dingdong
  • 169
  • 10
  • 1
    Can you post the actual specs2 modules you use? There's specs2 and specs2-core, and using the wrong one may lead to the error. Also, you may want to use the sbt-dependency-graph sbt plugin which could show which modules your project uses exactly. – jrudolph Jun 19 '15 at 06:07

1 Answers1

3

You probably need to add specs2-mock to your build.

// https://mvnrepository.com/artifact/org.specs2/specs2-mock
libraryDependencies += "org.specs2" %% "specs2-mock" % "4.3.5" % Test
consuela
  • 1,675
  • 6
  • 21
  • 24
Eric
  • 15,494
  • 38
  • 61
  • 1
    That worked, just strange that I didn't need this package for a different version of akka and spray. Can you give some more details as to why this occurs? – dingdong Jun 20 '15 at 08:01
  • 1
    Maybe they were pulling in this dependency for you and they stopped doing it? – Eric Jun 20 '15 at 11:50